restapi

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

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 CiliumHealthAPI

type CiliumHealthAPI 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 a "application/json" mime type
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for a "application/json" mime type
	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)

	// 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
}

CiliumHealthAPI Cilium Health Checker

func NewCiliumHealthAPI

func NewCiliumHealthAPI(spec *loads.Document) *CiliumHealthAPI

NewCiliumHealthAPI creates a new CiliumHealth instance

func (*CiliumHealthAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*CiliumHealthAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*CiliumHealthAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*CiliumHealthAPI) Context

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

Context returns the middleware context for the cilium health API

func (*CiliumHealthAPI) DefaultConsumes

func (o *CiliumHealthAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*CiliumHealthAPI) DefaultProduces

func (o *CiliumHealthAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*CiliumHealthAPI) Formats

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

Formats returns the registered string formats

func (*CiliumHealthAPI) HandlerFor

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

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

func (*CiliumHealthAPI) Init

func (o *CiliumHealthAPI) Init()

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

func (*CiliumHealthAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*CiliumHealthAPI) RegisterConsumer

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

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

func (*CiliumHealthAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*CiliumHealthAPI) RegisterProducer

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

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

func (*CiliumHealthAPI) Serve

func (o *CiliumHealthAPI) 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 (*CiliumHealthAPI) ServeErrorFor

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

ServeErrorFor gets a error handler for a given operation id

func (*CiliumHealthAPI) SetDefaultConsumes

func (o *CiliumHealthAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*CiliumHealthAPI) SetDefaultProduces

func (o *CiliumHealthAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*CiliumHealthAPI) SetSpec

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

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

func (*CiliumHealthAPI) Validate

func (o *CiliumHealthAPI) Validate() error

Validate validates the registrations in the CiliumHealthAPI

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 no default values defined in 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.

type GetHealthzURL

type GetHealthzURL struct {
	// contains filtered or unexported fields
}

GetHealthzURL generates an URL for the get healthz operation

func (*GetHealthzURL) Build

func (o *GetHealthzURL) Build() (*url.URL, error)

Build a url path and query string

func (*GetHealthzURL) BuildFull

func (o *GetHealthzURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*GetHealthzURL) Must

func (o *GetHealthzURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*GetHealthzURL) SetBasePath

func (o *GetHealthzURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*GetHealthzURL) String

func (o *GetHealthzURL) String() string

String returns the string representation of the path with query string

func (*GetHealthzURL) StringFull

func (o *GetHealthzURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*GetHealthzURL) WithBasePath

func (o *GetHealthzURL) WithBasePath(bp string) *GetHealthzURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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