Documentation
¶
Index ¶
- Constants
- func RegisterConnect(mux *http.ServeMux, services ...ConnectService)
- func RegisterHealth(mux *http.ServeMux, health Health)
- func RegisterReflection(mux *http.ServeMux, serviceNames ...string)
- func ServiceNames(services ...ConnectService) []string
- func SignalContext(parent context.Context) (context.Context, context.CancelFunc)
- type Check
- type ConnectService
- type Health
- type Protocols
- type Server
Constants ¶
View Source
const ( // LivenessService is the Kubernetes gRPC health service label for liveness. LivenessService = "liveness" // ReadinessService is the Kubernetes gRPC health service label for readiness. ReadinessService = "readiness" )
View Source
const (
// DefaultAddr is the default listen address for internal services.
DefaultAddr = ":8080"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterConnect ¶
func RegisterConnect(mux *http.ServeMux, services ...ConnectService)
RegisterConnect mounts Connect services on mux.
func RegisterHealth ¶
RegisterHealth mounts the standard gRPC health service on mux.
func RegisterReflection ¶
RegisterReflection mounts explicit Connect reflection handlers on mux.
func ServiceNames ¶
func ServiceNames(services ...ConnectService) []string
ServiceNames returns the service names for registration with reflection or health.
func SignalContext ¶
SignalContext returns a context canceled on SIGINT or SIGTERM.
Types ¶
type Check ¶
Check is a health dependency check.
func LivenessCheck ¶
LivenessCheck adapts fn into a liveness check.
type ConnectService ¶
ConnectService describes a generated Connect handler mounted on an HTTP mux.
type Health ¶
type Health struct {
Enabled bool
LivenessChecks []Check
ReadinessChecks []Check
ServiceNames []string
}
Health configures the standard gRPC health service.
type Server ¶
type Server struct {
Addr string
Handler http.Handler
ReadHeaderTimeout time.Duration
IdleTimeout time.Duration
ShutdownTimeout time.Duration
Protocols Protocols
TLSConfig *tls.Config
TLSCertFile string
TLSKeyFile string
Logger *slog.Logger
OnShutdown func()
}
Server runs an http.Handler with common lifecycle defaults.
Click to show internal directories.
Click to hide internal directories.