Documentation
¶
Index ¶
- Constants
- type AppAPI
- func (o *AppAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *AppAPI) Authorizer() runtime.Authorizer
- func (o *AppAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *AppAPI) Context() *middleware.Context
- func (o *AppAPI) DefaultConsumes() string
- func (o *AppAPI) DefaultProduces() string
- func (o *AppAPI) Formats() strfmt.Registry
- func (o *AppAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *AppAPI) Init()
- func (o *AppAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *AppAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *AppAPI) Serve(builder middleware.Builder) http.Handler
- func (o *AppAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *AppAPI) SetDefaultConsumes(mediaType string)
- func (o *AppAPI) SetDefaultProduces(mediaType string)
- func (o *AppAPI) SetSpec(spec *loads.Document)
- func (o *AppAPI) Validate() error
- type HealthCheck
- type HealthCheckHandler
- type HealthCheckHandlerFunc
- type HealthCheckOK
- type HealthCheckParams
- type HealthCheckServiceUnavailable
- func (o *HealthCheckServiceUnavailable) SetPayload(payload *models.HealthCheckResponse)
- func (o *HealthCheckServiceUnavailable) WithPayload(payload *models.HealthCheckResponse) *HealthCheckServiceUnavailable
- func (o *HealthCheckServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type HealthCheckURL
- func (o *HealthCheckURL) Build() (*url.URL, error)
- func (o *HealthCheckURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *HealthCheckURL) Must(u *url.URL, err error) *url.URL
- func (o *HealthCheckURL) SetBasePath(bp string)
- func (o *HealthCheckURL) String() string
- func (o *HealthCheckURL) StringFull(scheme, host string) string
- func (o *HealthCheckURL) WithBasePath(bp string) *HealthCheckURL
Constants ¶
const HealthCheckOKCode int = 200
HealthCheckOKCode is the HTTP code returned for type HealthCheckOK
HealthCheckServiceUnavailableCode is the HTTP code returned for type HealthCheckServiceUnavailable
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppAPI ¶
type AppAPI struct {
Middleware func(middleware.Builder) http.Handler
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implemention 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 implemention 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 implemention 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
// HealthCheckHandler sets the operation handler for the health check operation
HealthCheckHandler HealthCheckHandler
// 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
}
AppAPI Template Application
func (*AppAPI) AuthenticatorsFor ¶
func (o *AppAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*AppAPI) Authorizer ¶
func (o *AppAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*AppAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types
func (*AppAPI) Context ¶
func (o *AppAPI) Context() *middleware.Context
Context returns the middleware context for the app API
func (*AppAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*AppAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*AppAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*AppAPI) Init ¶
func (o *AppAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit
func (*AppAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types
func (*AppAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*AppAPI) Serve ¶
func (o *AppAPI) 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 (*AppAPI) ServeErrorFor ¶
ServeErrorFor gets a error handler for a given operation id
func (*AppAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*AppAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
type HealthCheck ¶
type HealthCheck struct {
Context *middleware.Context
Handler HealthCheckHandler
}
HealthCheck swagger:route GET /healthcheck healthCheck
Health Check ¶
The healthcheck endpoint provides information about the health of the service.
func NewHealthCheck ¶
func NewHealthCheck(ctx *middleware.Context, handler HealthCheckHandler) *HealthCheck
NewHealthCheck creates a new http.Handler for the health check operation
func (*HealthCheck) ServeHTTP ¶
func (o *HealthCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type HealthCheckHandler ¶
type HealthCheckHandler interface {
Handle(HealthCheckParams) middleware.Responder
}
HealthCheckHandler interface for that can handle valid health check params
type HealthCheckHandlerFunc ¶
type HealthCheckHandlerFunc func(HealthCheckParams) middleware.Responder
HealthCheckHandlerFunc turns a function with the right signature into a health check handler
func (HealthCheckHandlerFunc) Handle ¶
func (fn HealthCheckHandlerFunc) Handle(params HealthCheckParams) middleware.Responder
Handle executing the request and returning a response
type HealthCheckOK ¶
type HealthCheckOK struct {
/*
In: Body
*/
Payload *models.HealthCheckResponse `json:"body,omitempty"`
}
HealthCheckOK The service is functioning nominally
swagger:response healthCheckOK
func NewHealthCheckOK ¶
func NewHealthCheckOK() *HealthCheckOK
NewHealthCheckOK creates HealthCheckOK with default headers values
func (*HealthCheckOK) SetPayload ¶
func (o *HealthCheckOK) SetPayload(payload *models.HealthCheckResponse)
SetPayload sets the payload to the health check o k response
func (*HealthCheckOK) WithPayload ¶
func (o *HealthCheckOK) WithPayload(payload *models.HealthCheckResponse) *HealthCheckOK
WithPayload adds the payload to the health check o k response
func (*HealthCheckOK) WriteResponse ¶
func (o *HealthCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type HealthCheckParams ¶
HealthCheckParams contains all the bound params for the health check operation typically these are obtained from a http.Request
swagger:parameters healthCheck
func NewHealthCheckParams ¶
func NewHealthCheckParams() HealthCheckParams
NewHealthCheckParams creates a new HealthCheckParams object with the default values initialized.
func (*HealthCheckParams) BindRequest ¶
func (o *HealthCheckParams) 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
type HealthCheckServiceUnavailable ¶
type HealthCheckServiceUnavailable struct {
Payload *models.HealthCheckResponse `json:"body,omitempty"`
}
HealthCheckServiceUnavailable The service is not working correctly
swagger:response healthCheckServiceUnavailable
func NewHealthCheckServiceUnavailable ¶
func NewHealthCheckServiceUnavailable() *HealthCheckServiceUnavailable
NewHealthCheckServiceUnavailable creates HealthCheckServiceUnavailable with default headers values
func (*HealthCheckServiceUnavailable) SetPayload ¶
func (o *HealthCheckServiceUnavailable) SetPayload(payload *models.HealthCheckResponse)
SetPayload sets the payload to the health check service unavailable response
func (*HealthCheckServiceUnavailable) WithPayload ¶
func (o *HealthCheckServiceUnavailable) WithPayload(payload *models.HealthCheckResponse) *HealthCheckServiceUnavailable
WithPayload adds the payload to the health check service unavailable response
func (*HealthCheckServiceUnavailable) WriteResponse ¶
func (o *HealthCheckServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type HealthCheckURL ¶
type HealthCheckURL struct {
// contains filtered or unexported fields
}
HealthCheckURL generates an URL for the health check operation
func (*HealthCheckURL) Build ¶
func (o *HealthCheckURL) Build() (*url.URL, error)
Build a url path and query string
func (*HealthCheckURL) BuildFull ¶
func (o *HealthCheckURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*HealthCheckURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*HealthCheckURL) SetBasePath ¶
func (o *HealthCheckURL) 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 (*HealthCheckURL) String ¶
func (o *HealthCheckURL) String() string
String returns the string representation of the path with query string
func (*HealthCheckURL) StringFull ¶
func (o *HealthCheckURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*HealthCheckURL) WithBasePath ¶
func (o *HealthCheckURL) WithBasePath(bp string) *HealthCheckURL
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