Documentation
¶
Overview ¶
Package server Cilium Operator
Cilium Schemes: http Host: localhost BasePath: /v1 Version: v1beta Consumes: - application/json Produces: - application/json - text/plain
swagger:meta
Index ¶
- Variables
- type Server
- func (s *Server) ConfigureAPI()
- func (s *Server) ConfigureFlags()
- func (s *Server) Fatalf(f string, args ...interface{})
- func (s *Server) GetAPI() *restapi.CiliumOperatorAPI
- func (s *Server) GetHandler() http.Handler
- func (s *Server) HTTPListener() (net.Listener, error)
- func (s *Server) Listen() error
- func (s *Server) Logf(f string, args ...interface{})
- func (s *Server) Serve() error
- func (s *Server) SetAPI(api *restapi.CiliumOperatorAPI)
- func (s *Server) SetHandler(handler http.Handler)
- func (s *Server) Shutdown() error
- func (s *Server) Start(cell.HookContext) (err error)
- func (s *Server) Stop(ctx cell.HookContext) error
- func (s *Server) TLSListener() (net.Listener, error)
- func (s *Server) UnixListener() (*net.UnixListener, error)
- type ServerConfig
- type Spec
Constants ¶
This section is empty.
Variables ¶
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
var APICell = cell.Provide(newAPI)
APICell provides the restapi.CiliumOperatorAPI type, populated with the request handlers. This cell is an alternative to 'Cell' when only the API type is required and not the full server implementation.
var (
AdminEnableFlag = "enable-cilium-operator-server-access"
)
var Cell = cell.Module( "cilium-operator-server", "cilium operator server", cell.Provide(newForCell), APICell, )
Cell implements the cilium operator REST API server when provided the required request handlers.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
EnabledListeners []string
CleanupTimeout time.Duration
GracefulTimeout time.Duration
MaxHeaderSize int
SocketPath string
Host string
Port int
ListenLimit int
KeepAlive time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
TLSHost string
TLSPort int
TLSCertificate string
TLSCertificateKey string
TLSCACertificate string
TLSListenLimit int
TLSKeepAlive time.Duration
TLSReadTimeout time.Duration
TLSWriteTimeout time.Duration
// contains filtered or unexported fields
}
Server for the cilium operator API
func NewServer ¶
func NewServer(api *restapi.CiliumOperatorAPI) *Server
NewServer creates a new api cilium operator server but does not configure it
func (*Server) ConfigureAPI ¶
func (s *Server) ConfigureAPI()
ConfigureAPI configures the API and handlers.
func (*Server) ConfigureFlags ¶
func (s *Server) ConfigureFlags()
ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse
func (*Server) Fatalf ¶
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
func (*Server) GetAPI ¶
func (s *Server) GetAPI() *restapi.CiliumOperatorAPI
GetAPI returns the configured API. Modifications on the API must be performed before server is started.
func (*Server) GetHandler ¶
GetHandler returns a handler useful for testing
func (*Server) HTTPListener ¶
HTTPListener returns the http listener
func (*Server) Logf ¶
Logf logs message either via defined user logger or via system one if no user logger is defined.
func (*Server) SetAPI ¶
func (s *Server) SetAPI(api *restapi.CiliumOperatorAPI)
SetAPI configures the server with the specified API. Needs to be called before Serve
func (*Server) SetHandler ¶
SetHandler allows for setting a http handler on this server
func (*Server) TLSListener ¶
TLSListener returns the https listener
func (*Server) UnixListener ¶
func (s *Server) UnixListener() (*net.UnixListener, error)
UnixListener returns the domain socket listener
type ServerConfig ¶
type ServerConfig struct {
EnableCiliumOperatorServerAccess []string
}
func (ServerConfig) Flags ¶
func (cfg ServerConfig) Flags(flags *pflag.FlagSet)