Documentation ¶
Index ¶
- Constants
- Variables
- type Closer
- type CloserWithContext
- type Option
- func WithConfig(c *viper.Viper) Option
- func WithContext(ctx context.Context) Option
- func WithHTTPPrometheusService(enabled bool) Option
- func WithHTTPViperService(enabled bool) Option
- func WithHTTPZapService(enabled bool) Option
- func WithLogFields(fields ...zap.Field) Option
- func WithLogger(l *zap.Logger) Option
- func WithShutdownTimeout(shutdownTimeout time.Duration) Option
- type Server
- func (s *Server) AddCloser(closer interface{})
- func (s *Server) AddClosers(closers ...interface{})
- func (s *Server) AddService(service Service)
- func (s *Server) AddServices(services ...Service)
- func (s *Server) Config() *viper.Viper
- func (s *Server) Context() context.Context
- func (s *Server) Logger() *zap.Logger
- func (s *Server) Run()
- type Service
- type ServiceHTTP
- func NewDefaultServiceHTTPPrometheus() *ServiceHTTP
- func NewDefaultServiceHTTPViper() *ServiceHTTP
- func NewDefaultServiceHTTPZap() *ServiceHTTP
- func NewServiceHTTP(l *zap.Logger, name, addr string, handler http.Handler, ...) *ServiceHTTP
- func NewServiceHTTPPrometheus(l *zap.Logger, name, addr, path string) *ServiceHTTP
- func NewServiceHTTPViper(l *zap.Logger, c *viper.Viper, name, addr, path string) *ServiceHTTP
- func NewServiceHTTPZap(l *zap.Logger, name, addr, path string) *ServiceHTTP
- type Shutdowner
- type ShutdownerWithContext
- type Unsubscriber
- type UnsubscriberWithContext
Constants ¶
View Source
const ( DefaultServiceHTTPPrometheusName = "prometheus" DefaultServiceHTTPPrometheusAddr = ":9200" DefaultServiceHTTPPrometheusPath = "/metrics" )
View Source
const ( DefaultServiceHTTPViperName = "viper" DefaultServiceHTTPViperAddr = "localhost:9300" DefaultServiceHTTPViperPath = "/config" )
View Source
const ( DefaultServiceHTTPZapName = "zap" DefaultServiceHTTPZapAddr = "localhost:9100" DefaultServiceHTTPZapPath = "/log" )
Variables ¶
View Source
var ( // Version usage -ldflags "-X github.com/foomo/keel/server.Version=$VERSION" Version string // GitCommit usage -ldflags "-X github.com/foomo/keel/server.GitCommit=$GIT_COMMIT" GitCommit string // BuildTime usage -ldflags "-X 'github.com/foomo/keel/server.BuildTime=$(date -u '+%Y-%m-%d %H:%M:%S')'" BuildTime string )
Functions ¶
This section is empty.
Types ¶
type CloserWithContext ¶
CloserWithContext interface
type Option ¶
type Option func(inst *Server)
Option func
func WithHTTPPrometheusService ¶ added in v0.2.0
WithHTTPPrometheusService option with default value
func WithHTTPViperService ¶ added in v0.2.0
WithHTTPViperService option with default value
func WithHTTPZapService ¶ added in v0.2.0
WithHTTPZapService option with default value
func WithShutdownTimeout ¶
WithShutdownTimeout option
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server struct
func (*Server) AddCloser ¶
func (s *Server) AddCloser(closer interface{})
AddCloser adds a closer to be called on shutdown
func (*Server) AddClosers ¶
func (s *Server) AddClosers(closers ...interface{})
AddClosers adds an closer to be called on shutdown
func (*Server) AddService ¶
AddService add a single service
func (*Server) AddServices ¶
AddServices adds multiple service
type ServiceHTTP ¶
type ServiceHTTP struct {
// contains filtered or unexported fields
}
ServiceHTTP struct
func NewDefaultServiceHTTPPrometheus ¶
func NewDefaultServiceHTTPPrometheus() *ServiceHTTP
func NewDefaultServiceHTTPViper ¶
func NewDefaultServiceHTTPViper() *ServiceHTTP
func NewDefaultServiceHTTPZap ¶
func NewDefaultServiceHTTPZap() *ServiceHTTP
func NewServiceHTTP ¶
func NewServiceHTTP(l *zap.Logger, name, addr string, handler http.Handler, middlewares ...middleware.Middleware) *ServiceHTTP
func NewServiceHTTPPrometheus ¶
func NewServiceHTTPPrometheus(l *zap.Logger, name, addr, path string) *ServiceHTTP
func NewServiceHTTPViper ¶
func NewServiceHTTPZap ¶
func NewServiceHTTPZap(l *zap.Logger, name, addr, path string) *ServiceHTTP
type ShutdownerWithContext ¶
ShutdownerWithContext interface
type Unsubscriber ¶ added in v0.2.0
type Unsubscriber interface {
Unsubscribe() error
}
Unsubscriber interface
type UnsubscriberWithContext ¶ added in v0.2.0
UnsubscriberWithContext interface
Source Files ¶
Click to show internal directories.
Click to hide internal directories.