Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Kind is an optional string that describes the purpose of the server. It is used in logs to distinguish
// among multiple servers.
Kind string
// Log is the logger used by the server. If not set, a logger will be derived from the context passed to Start.
Log logr.Logger
// Server is the HTTP server to run. It is required.
Server *http.Server
// Listener is an optional listener to use. If not set, the server start a listener using the server.Addr.
// Using a listener is useful when the port reservation needs to happen in advance of this runnable starting.
Listener net.Listener
// OnlyServeWhenLeader is an optional bool that indicates that the server should only be started when the manager is the leader.
OnlyServeWhenLeader bool
// ShutdownTimeout is an optional duration that indicates how long to wait for the server to shutdown gracefully. If not set,
// the server will wait indefinitely for all connections to close.
ShutdownTimeout *time.Duration
}
Server is a general purpose HTTP(S) server Runnable for a manager. It is used to serve some internal handlers for health probes and profiling, but it can also be used to run custom servers.
func (*Server) NeedLeaderElection ¶
NeedLeaderElection returns true if the server should only be started when the manager is the leader.
Click to show internal directories.
Click to hide internal directories.