Documentation ¶
Index ¶
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 ¶
type Server interface { Router() *gin.Engine AddHealthz(urls ...string) AddReadyz(status *func() bool, urls ...string) Run(ctx context.Context, readyCallbacks ...func()) RunSecurely(ctx context.Context, readyCallbacks ...func()) // NamespaceValidation checks if namespace is in the query params NamespaceValidation() gin.HandlerFunc }
Server represents a HTTP Server with gin router and health probes
Click to show internal directories.
Click to hide internal directories.