pingcap/tidb

plugin: Allow introduce a custom web handler

Open

#10.914 aberto em 23 de jun. de 2019

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Go (6.186 forks)batch import
component/pluginfeature/acceptedhelp wantedtype/feature-request

Métricas do repositório

Stars
 (40.090 stars)
Métricas de merge de PR
 (Mesclagem média 14d 4h) (346 fundiu PRs em 30d)

Description

Feature Request

Is your feature request related to a problem? Please describe:

TiDB contains an HTTP interface at port :10080. A plugin may want to expose some status and configuration interface through this port.

Describe the feature you'd like:

Allow the plugin to provide an http.Handler from the Manifest.

type Manifest struct {
    ...
    Handler  http.Handler
}

Inside startHTTPServer(), for every plugin which has a non-nil Handler, route /plugins/«Name»/ to that handler (with StripPrefix).

Describe alternatives you've considered:

Do not support it, forcing plugins wanting to provide a web interface to choose a different port.

Teachability, Documentation, Adoption, Migration Strategy:

Guia do colaborador