Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API interface {
RegisterHandler(mux *httprouter.Router)
}
API is a service that exposes API routes
type App ¶
type App struct {
// contains filtered or unexported fields
}
An App is a modular application with HTTP server. It allows users to register custom Services and automatically deals with the lifecycle of those services on call to Run()
func (*App) RegisterService ¶
func (app *App) RegisterService(svc interface{})
4. Service Close: `svc.Close() error` Service
- MAY clean its state
type Checkable ¶
type Checkable interface {
RegisterCheck(h *health.Health) error
}
Checkable is a service that can expose its health status
type Closable ¶
type Closable interface {
Close() error
}
Closable is a service that needs to clean its state at the end of its execution
type Config ¶
type Config struct { Logger *kilnlog.Config Server *kilnhttp.ServerConfig Healthz *kilnhttp.ServerConfig StartTimeout *types.Duration StopTimeout *types.Duration }
func ConfigFromViper ¶ added in v0.3.1
ConfigFromViper construct app Config from viper
func (*Config) SetDefault ¶
type Initializable ¶
Initializable is a service that can initialize
type Loggable ¶
type Loggable interface {
SetLogger(logger logrus.FieldLogger)
}
Loggaable is a service that holds a logger
type Measurable ¶
type Measurable interface {
RegisterMetrics(prometheus.Registerer) error
}
Checkable is a service that can expose metrics
type Middleware ¶
Middleware is a service that exposes a middleware to be set on an App