Documentation
¶
Index ¶
- type HTTPServerConfiguration
- type Server
- func (s *Server) AddHealthz(urls ...string)
- func (s *Server) AddReadyz(status func() bool, urls ...string)
- func (s Server) NamespaceValidation() gin.HandlerFunc
- func (s *Server) Run(ctx context.Context, readyCallbacks ...func())
- func (s *Server) RunSecurely(ctx context.Context, readyCallbacks ...func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServerConfiguration ¶
type HTTPServerConfiguration struct {
Host string `envconfig:"HTTP_HOST" default:""`
Port int `envconfig:"HTTP_PORT" default:"80"`
RequestTimeout time.Duration `envconfig:"HTTP_REQUEST_TIMEOUT" default:"30s"`
UserID string `envconfig:"USER_ID" default:""`
CertificateFile string `envconfig:"CERTIFICATE_FILE" default:"/etc/tls/tls.crt"`
CertificateKeyFile string `envconfig:"CERTIFICATE_KEY_FILE" default:"/etc/tls/tls.key"`
HealthzEndpoint string `envconfig:"HEALTHZ_ENDPOINT" default:"/healthz"`
ReadyzEndpoint string `envconfig:"READYZ_ENDPOINT" default:"/readyz"`
}
HTTPServerConfiguration is a struct that holds all the environment variables required to the HTTP server
func (*HTTPServerConfiguration) LoadFromEnvVars ¶
func (h *HTTPServerConfiguration) LoadFromEnvVars() error
LoadFromEnvVars reads all env vars required for the server package
type Server ¶
Server defines a struct for server
func NewServer ¶
func NewServer(logger logging.Logger, configuration HTTPServerConfiguration) *Server
NewServer initializes a server
func (*Server) AddHealthz ¶ added in v0.2.0
AddHealthz creates a route to LivenessProbe
func (Server) NamespaceValidation ¶
func (s Server) NamespaceValidation() gin.HandlerFunc
NamespaceValidation checks if namespace is in the query params
func (*Server) Run ¶
Run when called starts the server warning: once the Run is called, you cannot modify the Handle in http.Server.
func (*Server) RunSecurely ¶
RunSecurely when called starts the https server warning: once the Run is called, you cannot modify the Handle in http.Server.
Click to show internal directories.
Click to hide internal directories.