Documentation
¶
Index ¶
- Constants
- func DefaultLogger() *slog.Logger
- type CheckFunc
- type Config
- type NamedCheck
- type Server
- type ServerOption
- func WithAddr(addr string) ServerOption
- func WithHandler(h http.Handler) ServerOption
- func WithIdleTimeout(d time.Duration) ServerOption
- func WithLivenessPath(path string) ServerOption
- func WithLogger(logger *slog.Logger) ServerOption
- func WithMetricsHandler(h http.Handler) ServerOption
- func WithPortFromEnv() ServerOption
- func WithReadHeaderTimeout(d time.Duration) ServerOption
- func WithReadTimeout(d time.Duration) ServerOption
- func WithReadinessCheck(name string, check CheckFunc) ServerOption
- func WithReadinessPath(path string) ServerOption
- func WithShutdownHook(hook ShutdownHook) ServerOption
- func WithShutdownTimeout(d time.Duration) ServerOption
- func WithWriteTimeout(d time.Duration) ServerOption
- func WithoutDefaultProbes() ServerOption
- type ShutdownHook
Constants ¶
View Source
const CONTENT_TYPE string = "Content-Type"
View Source
const CONTENT_TYPE_JSON string = "application/json"
View Source
const CONTENT_TYPE_PLAIN string = "text/plain; charset=utf-8"
Variables ¶
This section is empty.
Functions ¶
func DefaultLogger ¶
Types ¶
type NamedCheck ¶
type NamedCheck struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(options []ServerOption) *Server
type ServerOption ¶
type ServerOption func(*Config)
func WithAddr ¶
func WithAddr(addr string) ServerOption
func WithHandler ¶
func WithHandler(h http.Handler) ServerOption
func WithIdleTimeout ¶
func WithIdleTimeout(d time.Duration) ServerOption
func WithLivenessPath ¶
func WithLivenessPath(path string) ServerOption
func WithLogger ¶
func WithLogger(logger *slog.Logger) ServerOption
func WithMetricsHandler ¶
func WithMetricsHandler(h http.Handler) ServerOption
func WithPortFromEnv ¶
func WithPortFromEnv() ServerOption
func WithReadHeaderTimeout ¶
func WithReadHeaderTimeout(d time.Duration) ServerOption
func WithReadTimeout ¶
func WithReadTimeout(d time.Duration) ServerOption
func WithReadinessCheck ¶
func WithReadinessCheck(name string, check CheckFunc) ServerOption
func WithReadinessPath ¶
func WithReadinessPath(path string) ServerOption
func WithShutdownHook ¶
func WithShutdownHook(hook ShutdownHook) ServerOption
func WithShutdownTimeout ¶
func WithShutdownTimeout(d time.Duration) ServerOption
func WithWriteTimeout ¶
func WithWriteTimeout(d time.Duration) ServerOption
func WithoutDefaultProbes ¶
func WithoutDefaultProbes() ServerOption
type ShutdownHook ¶
Click to show internal directories.
Click to hide internal directories.