Documentation
¶
Index ¶
- Variables
- func AccessLogSkipPath(regex string) serverOpt
- func Address(address string) serverOpt
- func AppName(appName string) debugAPIOpt
- func AppVersion(appVersion string) debugAPIOpt
- func ApplyDebugAPIProperties(properties *DebugAPIProperties) debugAPIOpt
- func ApplyProperties(properties *Properties) serverOpt
- func HealthCheckHandler(handler HealthCheckHandlerFunc) debugAPIOpt
- func OnShutdown(callback func()) serverOpt
- func ShutdownTimeout(timeout time.Duration) serverOpt
- type DebugAPI
- type DebugAPIProperties
- type Endpoint
- type HealthCheckHandlerFunc
- type Properties
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var DisableAccessLog = func(config *serverConfig) { config.disableAccessLog = true }
View Source
var DisableHealthCheck = func(debugAPI *DebugAPI) { debugAPI.enableHealthCheck = false }
View Source
var DisableMethodNotAllowedHandler = func(config *serverConfig) { config.disableMethodNotAllowedHandler = true }
View Source
var DisableMetrics = func(debugAPI *DebugAPI) { debugAPI.enableMetrics = false }
View Source
var DisableNotFoundHandler = func(config *serverConfig) { config.disableNotFoundHandler = true }
View Source
var DisablePprof = func(debugAPI *DebugAPI) { debugAPI.enablePprof = false }
View Source
var DisableRecovery = func(config *serverConfig) { config.disableRecovery = true }
Functions ¶
func AccessLogSkipPath ¶
func AccessLogSkipPath(regex string) serverOpt
func AppVersion ¶
func AppVersion(appVersion string) debugAPIOpt
func ApplyDebugAPIProperties ¶
func ApplyDebugAPIProperties(properties *DebugAPIProperties) debugAPIOpt
func ApplyProperties ¶
func ApplyProperties(properties *Properties) serverOpt
func HealthCheckHandler ¶
func HealthCheckHandler(handler HealthCheckHandlerFunc) debugAPIOpt
func OnShutdown ¶
func OnShutdown(callback func()) serverOpt
func ShutdownTimeout ¶
Types ¶
type DebugAPI ¶
type DebugAPI struct {
// contains filtered or unexported fields
}
func NewDebugAPI ¶
func NewDebugAPI(opts ...debugAPIOpt) *DebugAPI
type DebugAPIProperties ¶
type DebugAPIProperties struct {
DisableMetrics bool `json:"disableMetrics" yaml:"disableMetrics"`
DisablePprof bool `json:"disablePprof" yaml:"disablePprof"`
DisableHealthcheck bool `json:"disableHealthcheck" yaml:"disableHealthcheck"`
AppName string `json:"appName" yaml:"appName"`
AppVersion string `json:"appVersion" yaml:"appVersion"`
}
type Endpoint ¶
func CreateEndpoint ¶
func CreateEndpoint(method, path string, handlers ...gin.HandlerFunc) Endpoint
type HealthCheckHandlerFunc ¶
type HealthCheckHandlerFunc = func() bool
type Properties ¶
type Properties struct {
Address string `json:"address" yaml:"address"`
ShutdownTimeout int64 `json:"shutdownTimeout" yaml:"shutdownTimeout"`
DisableRecovery bool `json:"disableRecovery" yaml:"disableRecovery"`
DisableAccessLog bool `json:"disableAccessLog" yaml:"disableAccessLog"`
AccessLogSkipPaths string `json:"accessLogSkipPaths" yaml:"accessLogSkipPaths"`
DisableMethodNotAllowedHandler bool `json:"disableMethodNotAllowedHandler" yaml:"disableMethodNotAllowedHandler"`
DisableNotFoundHandler bool `json:"disableNotFoundHandler" yaml:"disableNotFoundHandler"`
}
Click to show internal directories.
Click to hide internal directories.