Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
RegisterService(name string, cfg any, factory ServiceFactory) error // service name must match the unquoted yaml key format (e.g. [a-zA-Z_]+)
Run(config any)
}
Application is the main application interface
type Config ¶
type Config struct {
HTTP httpserver.Config `yaml:"http" group:"HTTP endpoint configuration"`
Sentry sentry.Config `yaml:"sentry" group:"Sentry configuration"`
ShutdownDelay time.Duration `yaml:"shutdown_delay" description:"Time to wait before shutting down"`
LogLevel string `yaml:"log_level" description:"Log level in production mode" default:"info" choices:"debug,info,warn,error,dpanic,panic,fatal"`
Production bool `yaml:"production" description:"Production mode"`
}
type HandlerDefinition ¶
type HandlerDefinition struct {
Endpoint string // used as "method" label for the `servicename_request_latency{method="endpoint"}` metric
Method string // GET, POST, etc.
Path string // URL path (Gorilla URL vars allowed)
Func httpserver.HandlerWithResult
}
HandlerDefinition contains method definition to use by HTTP server
type Options ¶ added in v0.4.1
type Options struct {
Logger log.MetaLogger
MetricsRegistry *metrics.Registry
ServiceReporter appstatus.ServiceStatusReporter
Production bool
ConfigPath string
}
AppInfo contains general app information and settings
Click to show internal directories.
Click to hide internal directories.