Documentation ¶
Index ¶
- func ConfigDump(w http.ResponseWriter, r *http.Request)
- func DeleteRegisteredAdminHandler(pattern string)
- func DisableLogger(w http.ResponseWriter, r *http.Request)
- func EnableLogger(w http.ResponseWriter, r *http.Request)
- func GetEnv(w http.ResponseWriter, r *http.Request)
- func GetLoggerInfo(w http.ResponseWriter, r *http.Request)
- func GetState(w http.ResponseWriter, r *http.Request)
- func Help(w http.ResponseWriter, r *http.Request)
- func KnownFeatures(w http.ResponseWriter, r *http.Request)
- func OutputVersion(w http.ResponseWriter, r *http.Request)
- func PluginApi(w http.ResponseWriter, r *http.Request)
- func RegisterAdminHandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func RegisterAdminHandler(pattern string, handler *APIHandler)
- func SetVersion(v string)
- func StatsDump(w http.ResponseWriter, r *http.Request)
- func StatsDumpProxyTotal(w http.ResponseWriter, r *http.Request)
- func UpdateLogLevel(w http.ResponseWriter, r *http.Request)
- type APIHandler
- type Auth
- type Config
- type LogLevelData
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDump ¶ added in v0.26.0
func ConfigDump(w http.ResponseWriter, r *http.Request)
func DeleteRegisteredAdminHandler ¶ added in v0.26.0
func DeleteRegisteredAdminHandler(pattern string)
DeleteRegisteredAdminHandler deletes a registered pattern
func DisableLogger ¶ added in v0.26.0
func DisableLogger(w http.ResponseWriter, r *http.Request)
func EnableLogger ¶ added in v0.26.0
func EnableLogger(w http.ResponseWriter, r *http.Request)
post data: loggeer path
func GetLoggerInfo ¶ added in v0.26.0
func GetLoggerInfo(w http.ResponseWriter, r *http.Request)
func GetState ¶ added in v0.26.0
func GetState(w http.ResponseWriter, r *http.Request)
returns data pid=xxx&state=xxx
func KnownFeatures ¶ added in v0.26.0
func KnownFeatures(w http.ResponseWriter, r *http.Request)
func OutputVersion ¶ added in v1.0.0
func OutputVersion(w http.ResponseWriter, r *http.Request)
func PluginApi ¶ added in v0.26.0
func PluginApi(w http.ResponseWriter, r *http.Request)
http://ip:port/plugin?enable=pluginname http://ip:port/plugin?disable=pluginname http://ip:port/plugin?status=pluginname http://ip:port/plugin?status=all
func RegisterAdminHandleFunc ¶
func RegisterAdminHandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
RegisterAdminHandleFunc keeps compatible for old ways
func RegisterAdminHandler ¶ added in v0.26.0
func RegisterAdminHandler(pattern string, handler *APIHandler)
RegisterAdminHandler registers a API Handler for amdin api, the Handler can contains auths and failed action.
func SetVersion ¶ added in v1.0.0
func SetVersion(v string)
func StatsDumpProxyTotal ¶ added in v0.26.0
func StatsDumpProxyTotal(w http.ResponseWriter, r *http.Request)
func UpdateLogLevel ¶ added in v0.26.0
func UpdateLogLevel(w http.ResponseWriter, r *http.Request)
Types ¶
type APIHandler ¶ added in v0.26.0
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler is a wrapper of http.Handler, which contains auth options
func NewAPIHandler ¶ added in v0.26.0
func NewAPIHandler(handler func(http.ResponseWriter, *http.Request), auths ...*Auth) *APIHandler
func (*APIHandler) ServeHTTP ¶ added in v0.26.0
func (h *APIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Auth ¶ added in v0.26.0
type Auth struct {
// contains filtered or unexported fields
}
Auth contains two parts: check function and failed function. if check function returns false, the Auth.Check will returns false and call failed function. if failed function is nil, use default instead. default function will write a http forbidden without body
type Config ¶
{ "admin":{ "address":{ "socket_address":{ "address": "0.0.0.0", "port_value": 8888 } } } }
type LogLevelData ¶
update log level