Documentation ¶
Overview ¶
Package frontend implements the frontend server of the load balancer
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MinTime is the default timestamp used for the begin of optional time ranges. // Exposed to let downstream projects to reference it. MinTime = time.Unix(math.MinInt64/1000+62135596801, 0).UTC() // MaxTime is the default timestamp used for the end of optional time ranges. // Exposed to let downstream projects to reference it. MaxTime = time.Unix(math.MaxInt64/1000-62135596801, 999999999).UTC() )
These functions are nicked from https://github.com/prometheus/prometheus/blob/main/web/api/v1/api.go
Functions ¶
func AllowRetry ¶
AllowRetry checks if a failed request can be retried
Types ¶
type Config ¶
type Config struct { Logger log.Logger Address string WebSystemdSocket bool WebConfigFile string DBPath string Manager serverpool.Manager }
Config makes a server config from CLI args
type LoadBalancer ¶
type LoadBalancer interface { Serve(http.ResponseWriter, *http.Request) Start() error Shutdown(context.Context) error }
LoadBalancer is the interface to implement
func NewLoadBalancer ¶
func NewLoadBalancer(c *Config) (LoadBalancer, error)
NewLoadBalancer returns a new instance of load balancer
type RetryContextKey ¶
type RetryContextKey struct{}
RetryContextKey is the key used to set context value for retry
Click to show internal directories.
Click to hide internal directories.