Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHealthCheckError = errors.New("health check error") ErrHealthCheckServiceStarting = errors.New("service is starting") )
Functions ¶
Types ¶
type Config ¶
type Config struct {
Enabled bool `default:"false" usage:"allows to enable ops server" example:"false"`
Network string `default:"tcp" required:"true" validate:"oneof=tcp udp" usage:"allows to set ops listen network: tcp/udp" example:"tcp"`
// Tracing
TracingEnabled bool `yaml:"tracing_enabled" default:"false" usage:"allows to enable tracing" example:"false"`
// Metrics
Metrics MetricsConfig
// Health checker
Healthy HealthCheckerConfig
// Profiler
Profiler ProfilerConfig
}
Config provides configuration for ops server.
type HealthCheckCode ¶ added in v0.2.10
type HealthCheckCode int
const ( HealthCheckCodeOk HealthCheckCode = 0 HealthCheckCodeError HealthCheckCode = 1 HealthCheckCodeServiceStarting HealthCheckCode = 2 )
type HealthCheckerConfig ¶ added in v0.2.0
type HealthCheckerConfig struct {
Enabled bool `default:"false" usage:"allows to enable health checker" example:"true"`
Path string `default:"/healthy" validate:"required" usage:"allows to set custom healthy path" example:"/healthy"`
Port string `default:"10000" validate:"required" usage:"allows to set custom healthy port" example:"10000"`
// contains filtered or unexported fields
}
func (*HealthCheckerConfig) AddServicesList ¶ added in v0.2.0
func (s *HealthCheckerConfig) AddServicesList(list []service.HealthChecker)
type MetricsConfig ¶ added in v0.2.0
type MetricsConfig struct {
Enabled bool `default:"false" usage:"allows to enable metrics" example:"true"`
Path string `default:"/metrics" validate:"required" usage:"allows to set custom metrics path" example:"/metrics"`
Port string `default:"10000" validate:"required" usage:"allows to set custom metrics port" example:"10000"`
BasicAuth http_transport.BasicAuthConfig `yaml:"basic_auth"`
}
type ProfilerConfig ¶ added in v0.2.0
type ProfilerConfig struct {
Enabled bool `default:"false" usage:"allows to enable profiler" example:"false"`
Path string `default:"/debug/pprof" validate:"required" usage:"allows to set custom profiler path" example:"/debug/pprof"`
Port string `default:"10000" validate:"required" usage:"allows to set custom profiler port" example:"10000"`
WriteTimeout int `yaml:"write_timeout" default:"60" usage:"HTTP server write timeout in seconds" example:"60"`
}
Click to show internal directories.
Click to hide internal directories.