Documentation ¶
Index ¶
- Variables
- func IsCloser(v any) bool
- func IsHealthz(v any) bool
- type Option
- func WithConfig(c *viper.Viper) Option
- func WithContext(ctx context.Context) Option
- func WithGracefulPeriod(gracefulPeriod time.Duration) Option
- func WithHTTPHealthzService(enabled bool) Option
- func WithHTTPPProfService(enabled bool) Option
- func WithHTTPPrometheusService(enabled bool) Option
- func WithHTTPReadmeService(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 WithOTLPGRPCTracer(enabled bool) Option
- func WithOTLPHTTPTracer(enabled bool) Option
- func WithPrometheusMeter(enabled bool) Option
- func WithRemoteConfig(provider, endpoint, path string) Option
- func WithShutdownSignals(shutdownSignals ...os.Signal) Option
- func WithStdOutMeter(enabled bool) Option
- func WithStdOutTracer(enabled bool) Option
- type Server
- func (s *Server) AddAlwaysHealthzers(probes ...interface{})
- func (s *Server) AddCloser(closer interface{})
- func (s *Server) AddClosers(closers ...interface{})
- func (s *Server) AddHealthzer(typ healthz.Type, probe interface{})
- func (s *Server) AddHealthzers(typ healthz.Type, probes ...interface{})
- func (s *Server) AddLivenessHealthzers(probes ...interface{})
- func (s *Server) AddReadinessHealthzers(probes ...interface{})
- func (s *Server) AddReadmer(readmer interfaces.Readmer)
- func (s *Server) AddReadmers(readmers ...interfaces.Readmer)
- func (s *Server) AddService(v Service)
- func (s *Server) AddServices(services ...Service)
- func (s *Server) AddStartupHealthzers(probes ...interface{})
- func (s *Server) Config() *viper.Viper
- func (s *Server) Context() context.Context
- func (s *Server) Healthz() error
- func (s *Server) Logger() *zap.Logger
- func (s *Server) Meter() metric.Meter
- func (s *Server) Readme() string
- func (s *Server) Run()
- func (s *Server) ShutdownCancel() context.CancelFunc
- func (s *Server) ShutdownContext() context.Context
- func (s *Server) Tracer() trace.Tracer
- type Service
- type ServiceEnabler
- type ServiceFunc
Constants ¶
This section is empty.
Variables ¶
var ( ErrServerNotRunning = errors.New("server not running") ErrServerShutdown = errors.New("server is shutting down") )
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 ¶
Types ¶
type Option ¶
type Option func(inst *Server)
Option func
func WithGracefulPeriod ¶ added in v0.18.0
WithGracefulPeriod option
func WithHTTPHealthzService ¶ added in v0.9.2
WithHTTPHealthzService option with default value
func WithHTTPPProfService ¶ added in v0.16.0
WithHTTPPProfService option with default value
func WithHTTPPrometheusService ¶ added in v0.2.0
WithHTTPPrometheusService option with default value
func WithHTTPReadmeService ¶ added in v0.17.0
WithHTTPReadmeService 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 WithOTLPGRPCTracer ¶ added in v0.8.0
WithOTLPGRPCTracer option with default value
func WithOTLPHTTPTracer ¶ added in v0.8.0
WithOTLPHTTPTracer option with default value
func WithPrometheusMeter ¶ added in v0.8.0
WithPrometheusMeter option with default value
func WithRemoteConfig ¶ added in v0.10.0
WithRemoteConfig option
func WithShutdownSignals ¶ added in v0.6.4
WithShutdownSignals option
func WithStdOutMeter ¶ added in v0.8.0
WithStdOutMeter option with default value
func WithStdOutTracer ¶ added in v0.8.0
WithStdOutTracer option with default value
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server struct
func (*Server) AddAlwaysHealthzers ¶ added in v0.9.3
func (s *Server) AddAlwaysHealthzers(probes ...interface{})
AddAlwaysHealthzers adds the probes to be called on any healthz checks
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 the given closers to be called on shutdown
func (*Server) AddHealthzer ¶ added in v0.9.3
AddHealthzer adds a probe to be called on healthz checks
func (*Server) AddHealthzers ¶ added in v0.9.3
AddHealthzers adds the given probes to be called on healthz checks
func (*Server) AddLivenessHealthzers ¶ added in v0.9.3
func (s *Server) AddLivenessHealthzers(probes ...interface{})
AddLivenessHealthzers adds the liveness probes to be called on healthz checks
func (*Server) AddReadinessHealthzers ¶ added in v0.9.3
func (s *Server) AddReadinessHealthzers(probes ...interface{})
AddReadinessHealthzers adds the readiness probes to be called on healthz checks
func (*Server) AddReadmer ¶ added in v0.17.0
func (s *Server) AddReadmer(readmer interfaces.Readmer)
AddReadmer adds a readmer to be added to the exposed readme
func (*Server) AddReadmers ¶ added in v0.17.0
func (s *Server) AddReadmers(readmers ...interfaces.Readmer)
AddReadmers adds readmers to be added to the exposed readme
func (*Server) AddServices ¶
AddServices adds multiple service
func (*Server) AddStartupHealthzers ¶ added in v0.9.3
func (s *Server) AddStartupHealthzers(probes ...interface{})
AddStartupHealthzers adds the startup probes to be called on healthz checks
func (*Server) ShutdownCancel ¶ added in v0.18.0
func (s *Server) ShutdownCancel() context.CancelFunc
ShutdownCancel returns server's shutdown cancel function
func (*Server) ShutdownContext ¶ added in v0.18.0
ShutdownContext returns server's shutdown cancel context
type Service ¶
type Service interface { Name() string Start(ctx context.Context) error Close(ctx context.Context) error }
Service interface
type ServiceEnabler ¶ added in v0.10.12
type ServiceEnabler struct {
// contains filtered or unexported fields
}
func NewServiceEnabler ¶ added in v0.10.12
func NewServiceEnabler(l *zap.Logger, name string, serviceFn ServiceFunc, enabledFn func() bool) *ServiceEnabler
func (*ServiceEnabler) Close ¶ added in v0.10.12
func (w *ServiceEnabler) Close(ctx context.Context) error
func (*ServiceEnabler) Name ¶ added in v0.10.12
func (w *ServiceEnabler) Name() string
type ServiceFunc ¶ added in v0.10.12
type ServiceFunc func() Service