restapi

package
v1.16.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

View Source
const GetHealthzFailedCode int = 500

GetHealthzFailedCode is the HTTP code returned for type GetHealthzFailed

View Source
const GetHealthzOKCode int = 200

GetHealthzOKCode is the HTTP code returned for type GetHealthzOK

Variables

This section is empty.

Functions

This section is empty.

Types

type CiliumHealthAPIAPI

type CiliumHealthAPIAPI struct {
	Middleware func(middleware.Builder) http.Handler

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator

	// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator

	// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator

	// JSONConsumer registers a consumer for the following mime types:
	//   - application/json
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for the following mime types:
	//   - application/json
	JSONProducer runtime.Producer

	// GetHealthzHandler sets the operation handler for the get healthz operation
	GetHealthzHandler GetHealthzHandler
	// ConnectivityGetStatusHandler sets the operation handler for the get status operation
	ConnectivityGetStatusHandler connectivity.GetStatusHandler
	// ConnectivityPutStatusProbeHandler sets the operation handler for the put status probe operation
	ConnectivityPutStatusProbeHandler connectivity.PutStatusProbeHandler

	// ServeError is called when an error is received, there is a default handler
	// but you can set your own with this
	ServeError func(http.ResponseWriter, *http.Request, error)

	// PreServerShutdown is called before the HTTP(S) server is shutdown
	// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
	PreServerShutdown func()

	// ServerShutdown is called when the HTTP(S) server is shut down and done
	// handling all active connections and does not accept connections any more
	ServerShutdown func()

	// Custom command line argument groups with their descriptions
	CommandLineOptionsGroups []swag.CommandLineOptionsGroup

	// User defined logger function.
	Logger func(string, ...interface{})
	// contains filtered or unexported fields
}

CiliumHealthAPIAPI Cilium Health Checker

func NewCiliumHealthAPIAPI

func NewCiliumHealthAPIAPI(spec *loads.Document) *CiliumHealthAPIAPI

NewCiliumHealthAPIAPI creates a new CiliumHealthAPI instance

func (*CiliumHealthAPIAPI) AddMiddlewareFor

func (o *CiliumHealthAPIAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)

AddMiddlewareFor adds a http middleware to existing handler

func (*CiliumHealthAPIAPI) AuthenticatorsFor

func (o *CiliumHealthAPIAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*CiliumHealthAPIAPI) Authorizer

func (o *CiliumHealthAPIAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*CiliumHealthAPIAPI) ConsumersFor

func (o *CiliumHealthAPIAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.

func (*CiliumHealthAPIAPI) Context

func (o *CiliumHealthAPIAPI) Context() *middleware.Context

Context returns the middleware context for the cilium health API API

func (*CiliumHealthAPIAPI) DefaultConsumes

func (o *CiliumHealthAPIAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*CiliumHealthAPIAPI) DefaultProduces

func (o *CiliumHealthAPIAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*CiliumHealthAPIAPI) Formats

func (o *CiliumHealthAPIAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*CiliumHealthAPIAPI) HandlerFor

func (o *CiliumHealthAPIAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*CiliumHealthAPIAPI) Init

func (o *CiliumHealthAPIAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit

func (*CiliumHealthAPIAPI) ProducersFor

func (o *CiliumHealthAPIAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.

func (*CiliumHealthAPIAPI) RegisterConsumer

func (o *CiliumHealthAPIAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*CiliumHealthAPIAPI) RegisterFormat

func (o *CiliumHealthAPIAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*CiliumHealthAPIAPI) RegisterProducer

func (o *CiliumHealthAPIAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*CiliumHealthAPIAPI) Serve

func (o *CiliumHealthAPIAPI) Serve(builder middleware.Builder) http.Handler

Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))

func (*CiliumHealthAPIAPI) ServeErrorFor

func (o *CiliumHealthAPIAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*CiliumHealthAPIAPI) SetDefaultConsumes

func (o *CiliumHealthAPIAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*CiliumHealthAPIAPI) SetDefaultProduces

func (o *CiliumHealthAPIAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*CiliumHealthAPIAPI) SetSpec

func (o *CiliumHealthAPIAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*CiliumHealthAPIAPI) UseRedoc

func (o *CiliumHealthAPIAPI) UseRedoc()

UseRedoc for documentation at /docs

func (*CiliumHealthAPIAPI) UseSwaggerUI

func (o *CiliumHealthAPIAPI) UseSwaggerUI()

UseSwaggerUI for documentation at /docs

func (*CiliumHealthAPIAPI) Validate

func (o *CiliumHealthAPIAPI) Validate() error

Validate validates the registrations in the CiliumHealthAPIAPI

type GetHealthz

type GetHealthz struct {
	Context *middleware.Context
	Handler GetHealthzHandler
}
GetHealthz swagger:route GET /healthz getHealthz

Get health of Cilium node

Returns health and status information of the local node including load and uptime, as well as the status of related components including the Cilium daemon.

func NewGetHealthz

func NewGetHealthz(ctx *middleware.Context, handler GetHealthzHandler) *GetHealthz

NewGetHealthz creates a new http.Handler for the get healthz operation

func (*GetHealthz) ServeHTTP

func (o *GetHealthz) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type GetHealthzFailed

type GetHealthzFailed struct {

	/*
	  In: Body
	*/
	Payload models.Error `json:"body,omitempty"`
}

GetHealthzFailed Failed to contact local Cilium daemon

swagger:response getHealthzFailed

func NewGetHealthzFailed

func NewGetHealthzFailed() *GetHealthzFailed

NewGetHealthzFailed creates GetHealthzFailed with default headers values

func (*GetHealthzFailed) SetPayload

func (o *GetHealthzFailed) SetPayload(payload models.Error)

SetPayload sets the payload to the get healthz failed response

func (*GetHealthzFailed) WithPayload

func (o *GetHealthzFailed) WithPayload(payload models.Error) *GetHealthzFailed

WithPayload adds the payload to the get healthz failed response

func (*GetHealthzFailed) WriteResponse

func (o *GetHealthzFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetHealthzHandler

type GetHealthzHandler interface {
	Handle(GetHealthzParams) middleware.Responder
}

GetHealthzHandler interface for that can handle valid get healthz params

type GetHealthzHandlerFunc

type GetHealthzHandlerFunc func(GetHealthzParams) middleware.Responder

GetHealthzHandlerFunc turns a function with the right signature into a get healthz handler

func (GetHealthzHandlerFunc) Handle

Handle executing the request and returning a response

type GetHealthzOK

type GetHealthzOK struct {

	/*
	  In: Body
	*/
	Payload *models.HealthResponse `json:"body,omitempty"`
}

GetHealthzOK Success

swagger:response getHealthzOK

func NewGetHealthzOK

func NewGetHealthzOK() *GetHealthzOK

NewGetHealthzOK creates GetHealthzOK with default headers values

func (*GetHealthzOK) SetPayload

func (o *GetHealthzOK) SetPayload(payload *models.HealthResponse)

SetPayload sets the payload to the get healthz o k response

func (*GetHealthzOK) WithPayload

func (o *GetHealthzOK) WithPayload(payload *models.HealthResponse) *GetHealthzOK

WithPayload adds the payload to the get healthz o k response

func (*GetHealthzOK) WriteResponse

func (o *GetHealthzOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetHealthzParams

type GetHealthzParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`
}

GetHealthzParams contains all the bound params for the get healthz operation typically these are obtained from a http.Request

swagger:parameters GetHealthz

func NewGetHealthzParams

func NewGetHealthzParams() GetHealthzParams

NewGetHealthzParams creates a new GetHealthzParams object

There are no default values defined in the spec.

func (*GetHealthzParams) BindRequest

func (o *GetHealthzParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewGetHealthzParams() beforehand.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL