Documentation
¶
Overview ¶
Package config handles loading, validating, and applying defaults to Packhorse configuration files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ApplyDefaults ¶
ApplyDefaults fills in default values for optional fields not set in the config file.
func ParseDuration ¶
ParseDuration parses a Go-style duration string, returning zero if empty.
func ParseSizeString ¶
ParseSizeString parses a human-readable size string like "50GB" into bytes.
Types ¶
type ServerTimeouts ¶
type ServerTimeouts struct {
Read time.Duration
ReadHeader time.Duration
Write time.Duration
Idle time.Duration
// Shutdown bounds the graceful shutdown: how long http.Server.Shutdown
// waits for in-flight requests to finish after it stops accepting new
// connections.
Shutdown time.Duration
// Drain is the pre-shutdown grace period, not the in-flight drain (that's
// Shutdown). It keeps the server accepting NEW connections while Kubernetes
// endpoint removal -- triggered by pod deletion, not the readiness probe --
// propagates through kube-proxy, so requests still routed to the pod are
// served rather than refused. Readiness is also failed (readyz -> 503) as
// complementary signaling.
Drain time.Duration
}
ServerTimeouts holds parsed duration values for all server timeout fields.
func ParseServerTimeouts ¶
func ParseServerTimeouts(s *configpb.ServerConfig) (ServerTimeouts, error)
ParseServerTimeouts parses all server timeout fields from the config.
Click to show internal directories.
Click to hide internal directories.