Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGenericAPIServer ¶
func InitGenericAPIServer(c *GenericAPIServer)
func LoadConfig ¶
LoadConfig reads in config file and ENV variables if set.
func RequestShutdown ¶
func RequestShutdown() bool
RequestShutdown emulates a received event that is considered as shutdown signal (SIGTERM/SIGINT) This returns whether a handler was notified.
func SetupSignalHandler ¶
func SetupSignalHandler() <-chan struct{}
SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
Types ¶
type CertKey ¶
type CertKey struct { // CertFile is a file containing a PEM-encoded certificate, and possibly the complete certificate chain CertFile string // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile KeyFile string }
CertKey contains configuration items related to certificate.
type Config ¶
type Config struct { InsecureServing *InsecureServingInfo SecureServing *SecureServingInfo Jwt *JwtInfo Mode string Middlewares []string Healthz bool EnableProfiling bool EnableMetrics bool }
type GenericAPIServer ¶
type GenericAPIServer struct { Middlewares []string Mode string // InsecureServingInfo holds configuration of the insecure HTTP server. InsecureServingInfo *InsecureServingInfo // SecureServingInfo holds configutation of the TLS server. SecureServingInfo *SecureServingInfo ShutdownTimeout time.Duration *gin.Engine Healthz bool // contains filtered or unexported fields }
GenericAPIServer contains state for a filestore api server. type GenericAPIServer gin.Engin.
func (*GenericAPIServer) Close ¶
func (s *GenericAPIServer) Close()
Close graceful shutdown the api server.
func (*GenericAPIServer) InstallAPIs ¶
func (s *GenericAPIServer) InstallAPIs()
InstallAPIs install generic apis.
func (*GenericAPIServer) InstallMiddlewares ¶
func (s *GenericAPIServer) InstallMiddlewares()
InstallMiddlewares install all middlewares.
func (*GenericAPIServer) Run ¶
func (s *GenericAPIServer) Run() error
Run spawns the http server. It only returns when the port cannot be listened on initially.
func (*GenericAPIServer) Setup ¶
func (s *GenericAPIServer) Setup()
type InsecureServingInfo ¶
type InsecureServingInfo struct {
Address string
}
InsecureServingInfo holds configuration of the insecure http server.
type SecureServingInfo ¶
SecureServingInfo holds configuration of the TLS server.