Documentation ¶
Index ¶
- Constants
- type CheckHealth
- type CheckHealthHandler
- type CheckHealthHandlerFunc
- type CheckHealthOK
- type CheckHealthParams
- type CheckHealthURL
- func (o *CheckHealthURL) Build() (*url.URL, error)
- func (o *CheckHealthURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *CheckHealthURL) Must(u *url.URL, err error) *url.URL
- func (o *CheckHealthURL) SetBasePath(bp string)
- func (o *CheckHealthURL) String() string
- func (o *CheckHealthURL) StringFull(scheme, host string) string
- func (o *CheckHealthURL) WithBasePath(bp string) *CheckHealthURL
- type GetHelloUser
- type GetHelloUserBadRequest
- type GetHelloUserHandler
- type GetHelloUserHandlerFunc
- type GetHelloUserOK
- type GetHelloUserParams
- type GetHelloUserURL
- func (o *GetHelloUserURL) Build() (*url.URL, error)
- func (o *GetHelloUserURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetHelloUserURL) Must(u *url.URL, err error) *url.URL
- func (o *GetHelloUserURL) SetBasePath(bp string)
- func (o *GetHelloUserURL) String() string
- func (o *GetHelloUserURL) StringFull(scheme, host string) string
- func (o *GetHelloUserURL) WithBasePath(bp string) *GetHelloUserURL
- type GetOopsUser
- type GetOopsUserBadRequest
- type GetOopsUserHandler
- type GetOopsUserHandlerFunc
- type GetOopsUserOK
- type GetOopsUserParams
- type GetOopsUserURL
- func (o *GetOopsUserURL) Build() (*url.URL, error)
- func (o *GetOopsUserURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetOopsUserURL) Must(u *url.URL, err error) *url.URL
- func (o *GetOopsUserURL) SetBasePath(bp string)
- func (o *GetOopsUserURL) String() string
- func (o *GetOopsUserURL) StringFull(scheme, host string) string
- func (o *GetOopsUserURL) WithBasePath(bp string) *GetOopsUserURL
- type HelloAPI
- func (o *HelloAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *HelloAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *HelloAPI) Authorizer() runtime.Authorizer
- func (o *HelloAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *HelloAPI) Context() *middleware.Context
- func (o *HelloAPI) DefaultConsumes() string
- func (o *HelloAPI) DefaultProduces() string
- func (o *HelloAPI) Formats() strfmt.Registry
- func (o *HelloAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *HelloAPI) Init()
- func (o *HelloAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *HelloAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *HelloAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *HelloAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *HelloAPI) Serve(builder middleware.Builder) http.Handler
- func (o *HelloAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *HelloAPI) SetDefaultConsumes(mediaType string)
- func (o *HelloAPI) SetDefaultProduces(mediaType string)
- func (o *HelloAPI) SetSpec(spec *loads.Document)
- func (o *HelloAPI) Validate() error
Constants ¶
const CheckHealthOKCode int = 200
CheckHealthOKCode is the HTTP code returned for type CheckHealthOK
const GetHelloUserBadRequestCode int = 400
GetHelloUserBadRequestCode is the HTTP code returned for type GetHelloUserBadRequest
const GetHelloUserOKCode int = 200
GetHelloUserOKCode is the HTTP code returned for type GetHelloUserOK
const GetOopsUserBadRequestCode int = 400
GetOopsUserBadRequestCode is the HTTP code returned for type GetOopsUserBadRequest
const GetOopsUserOKCode int = 200
GetOopsUserOKCode is the HTTP code returned for type GetOopsUserOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckHealth ¶
type CheckHealth struct { Context *middleware.Context Handler CheckHealthHandler }
CheckHealth swagger:route GET /healthz checkHealth
CheckHealth check health API
func NewCheckHealth ¶
func NewCheckHealth(ctx *middleware.Context, handler CheckHealthHandler) *CheckHealth
NewCheckHealth creates a new http.Handler for the check health operation
func (*CheckHealth) ServeHTTP ¶
func (o *CheckHealth) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type CheckHealthHandler ¶
type CheckHealthHandler interface {
Handle(CheckHealthParams) middleware.Responder
}
CheckHealthHandler interface for that can handle valid check health params
type CheckHealthHandlerFunc ¶
type CheckHealthHandlerFunc func(CheckHealthParams) middleware.Responder
CheckHealthHandlerFunc turns a function with the right signature into a check health handler
func (CheckHealthHandlerFunc) Handle ¶
func (fn CheckHealthHandlerFunc) Handle(params CheckHealthParams) middleware.Responder
Handle executing the request and returning a response
type CheckHealthOK ¶
type CheckHealthOK struct { /* In: Body */ Payload string `json:"body,omitempty"` }
CheckHealthOK OK message
swagger:response checkHealthOK
func NewCheckHealthOK ¶
func NewCheckHealthOK() *CheckHealthOK
NewCheckHealthOK creates CheckHealthOK with default headers values
func (*CheckHealthOK) SetPayload ¶
func (o *CheckHealthOK) SetPayload(payload string)
SetPayload sets the payload to the check health o k response
func (*CheckHealthOK) WithPayload ¶
func (o *CheckHealthOK) WithPayload(payload string) *CheckHealthOK
WithPayload adds the payload to the check health o k response
func (*CheckHealthOK) WriteResponse ¶
func (o *CheckHealthOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type CheckHealthParams ¶
CheckHealthParams contains all the bound params for the check health operation typically these are obtained from a http.Request
swagger:parameters checkHealth
func NewCheckHealthParams ¶
func NewCheckHealthParams() CheckHealthParams
NewCheckHealthParams creates a new CheckHealthParams object no default values defined in spec.
func (*CheckHealthParams) BindRequest ¶
func (o *CheckHealthParams) 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 NewCheckHealthParams() beforehand.
type CheckHealthURL ¶
type CheckHealthURL struct {
// contains filtered or unexported fields
}
CheckHealthURL generates an URL for the check health operation
func (*CheckHealthURL) Build ¶
func (o *CheckHealthURL) Build() (*url.URL, error)
Build a url path and query string
func (*CheckHealthURL) BuildFull ¶
func (o *CheckHealthURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*CheckHealthURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*CheckHealthURL) SetBasePath ¶
func (o *CheckHealthURL) 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 (*CheckHealthURL) String ¶
func (o *CheckHealthURL) String() string
String returns the string representation of the path with query string
func (*CheckHealthURL) StringFull ¶
func (o *CheckHealthURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*CheckHealthURL) WithBasePath ¶
func (o *CheckHealthURL) WithBasePath(bp string) *CheckHealthURL
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
type GetHelloUser ¶
type GetHelloUser struct { Context *middleware.Context Handler GetHelloUserHandler }
GetHelloUser swagger:route GET /hello/{user} getHelloUser
Returns a greeting to the user!
func NewGetHelloUser ¶
func NewGetHelloUser(ctx *middleware.Context, handler GetHelloUserHandler) *GetHelloUser
NewGetHelloUser creates a new http.Handler for the get hello user operation
func (*GetHelloUser) ServeHTTP ¶
func (o *GetHelloUser) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetHelloUserBadRequest ¶
type GetHelloUserBadRequest struct { }
GetHelloUserBadRequest Invalid characters in "user" were provided.
swagger:response getHelloUserBadRequest
func NewGetHelloUserBadRequest ¶
func NewGetHelloUserBadRequest() *GetHelloUserBadRequest
NewGetHelloUserBadRequest creates GetHelloUserBadRequest with default headers values
func (*GetHelloUserBadRequest) WriteResponse ¶
func (o *GetHelloUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetHelloUserHandler ¶
type GetHelloUserHandler interface {
Handle(GetHelloUserParams) middleware.Responder
}
GetHelloUserHandler interface for that can handle valid get hello user params
type GetHelloUserHandlerFunc ¶
type GetHelloUserHandlerFunc func(GetHelloUserParams) middleware.Responder
GetHelloUserHandlerFunc turns a function with the right signature into a get hello user handler
func (GetHelloUserHandlerFunc) Handle ¶
func (fn GetHelloUserHandlerFunc) Handle(params GetHelloUserParams) middleware.Responder
Handle executing the request and returning a response
type GetHelloUserOK ¶
type GetHelloUserOK struct { /* In: Body */ Payload string `json:"body,omitempty"` }
GetHelloUserOK Returns the greeting.
swagger:response getHelloUserOK
func NewGetHelloUserOK ¶
func NewGetHelloUserOK() *GetHelloUserOK
NewGetHelloUserOK creates GetHelloUserOK with default headers values
func (*GetHelloUserOK) SetPayload ¶
func (o *GetHelloUserOK) SetPayload(payload string)
SetPayload sets the payload to the get hello user o k response
func (*GetHelloUserOK) WithPayload ¶
func (o *GetHelloUserOK) WithPayload(payload string) *GetHelloUserOK
WithPayload adds the payload to the get hello user o k response
func (*GetHelloUserOK) WriteResponse ¶
func (o *GetHelloUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetHelloUserParams ¶
type GetHelloUserParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*The name of the user to greet. Required: true In: path */ User string }
GetHelloUserParams contains all the bound params for the get hello user operation typically these are obtained from a http.Request
swagger:parameters GetHelloUser
func NewGetHelloUserParams ¶
func NewGetHelloUserParams() GetHelloUserParams
NewGetHelloUserParams creates a new GetHelloUserParams object no default values defined in spec.
func (*GetHelloUserParams) BindRequest ¶
func (o *GetHelloUserParams) 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 NewGetHelloUserParams() beforehand.
type GetHelloUserURL ¶
type GetHelloUserURL struct { User string // contains filtered or unexported fields }
GetHelloUserURL generates an URL for the get hello user operation
func (*GetHelloUserURL) Build ¶
func (o *GetHelloUserURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetHelloUserURL) BuildFull ¶
func (o *GetHelloUserURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetHelloUserURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetHelloUserURL) SetBasePath ¶
func (o *GetHelloUserURL) 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 (*GetHelloUserURL) String ¶
func (o *GetHelloUserURL) String() string
String returns the string representation of the path with query string
func (*GetHelloUserURL) StringFull ¶
func (o *GetHelloUserURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetHelloUserURL) WithBasePath ¶
func (o *GetHelloUserURL) WithBasePath(bp string) *GetHelloUserURL
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
type GetOopsUser ¶
type GetOopsUser struct { Context *middleware.Context Handler GetOopsUserHandler }
GetOopsUser swagger:route GET /oops/{user} getOopsUser
Returns a greeting to the user!
func NewGetOopsUser ¶
func NewGetOopsUser(ctx *middleware.Context, handler GetOopsUserHandler) *GetOopsUser
NewGetOopsUser creates a new http.Handler for the get oops user operation
func (*GetOopsUser) ServeHTTP ¶
func (o *GetOopsUser) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetOopsUserBadRequest ¶
type GetOopsUserBadRequest struct { }
GetOopsUserBadRequest Invalid characters in "user" were provided.
swagger:response getOopsUserBadRequest
func NewGetOopsUserBadRequest ¶
func NewGetOopsUserBadRequest() *GetOopsUserBadRequest
NewGetOopsUserBadRequest creates GetOopsUserBadRequest with default headers values
func (*GetOopsUserBadRequest) WriteResponse ¶
func (o *GetOopsUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOopsUserHandler ¶
type GetOopsUserHandler interface {
Handle(GetOopsUserParams) middleware.Responder
}
GetOopsUserHandler interface for that can handle valid get oops user params
type GetOopsUserHandlerFunc ¶
type GetOopsUserHandlerFunc func(GetOopsUserParams) middleware.Responder
GetOopsUserHandlerFunc turns a function with the right signature into a get oops user handler
func (GetOopsUserHandlerFunc) Handle ¶
func (fn GetOopsUserHandlerFunc) Handle(params GetOopsUserParams) middleware.Responder
Handle executing the request and returning a response
type GetOopsUserOK ¶
type GetOopsUserOK struct { /* In: Body */ Payload string `json:"body,omitempty"` }
GetOopsUserOK Returns the greeting.
swagger:response getOopsUserOK
func NewGetOopsUserOK ¶
func NewGetOopsUserOK() *GetOopsUserOK
NewGetOopsUserOK creates GetOopsUserOK with default headers values
func (*GetOopsUserOK) SetPayload ¶
func (o *GetOopsUserOK) SetPayload(payload string)
SetPayload sets the payload to the get oops user o k response
func (*GetOopsUserOK) WithPayload ¶
func (o *GetOopsUserOK) WithPayload(payload string) *GetOopsUserOK
WithPayload adds the payload to the get oops user o k response
func (*GetOopsUserOK) WriteResponse ¶
func (o *GetOopsUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOopsUserParams ¶
type GetOopsUserParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*The name of the user to greet. Required: true In: path */ User string }
GetOopsUserParams contains all the bound params for the get oops user operation typically these are obtained from a http.Request
swagger:parameters GetOopsUser
func NewGetOopsUserParams ¶
func NewGetOopsUserParams() GetOopsUserParams
NewGetOopsUserParams creates a new GetOopsUserParams object no default values defined in spec.
func (*GetOopsUserParams) BindRequest ¶
func (o *GetOopsUserParams) 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 NewGetOopsUserParams() beforehand.
type GetOopsUserURL ¶
type GetOopsUserURL struct { User string // contains filtered or unexported fields }
GetOopsUserURL generates an URL for the get oops user operation
func (*GetOopsUserURL) Build ¶
func (o *GetOopsUserURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetOopsUserURL) BuildFull ¶
func (o *GetOopsUserURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetOopsUserURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetOopsUserURL) SetBasePath ¶
func (o *GetOopsUserURL) 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 (*GetOopsUserURL) String ¶
func (o *GetOopsUserURL) String() string
String returns the string representation of the path with query string
func (*GetOopsUserURL) StringFull ¶
func (o *GetOopsUserURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetOopsUserURL) WithBasePath ¶
func (o *GetOopsUserURL) WithBasePath(bp string) *GetOopsUserURL
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
type HelloAPI ¶
type HelloAPI 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 // TxtProducer registers a producer for the following mime types: // - text/plain TxtProducer runtime.Producer // GetHelloUserHandler sets the operation handler for the get hello user operation GetHelloUserHandler GetHelloUserHandler // GetOopsUserHandler sets the operation handler for the get oops user operation GetOopsUserHandler GetOopsUserHandler // CheckHealthHandler sets the operation handler for the check health operation CheckHealthHandler CheckHealthHandler // 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 }
HelloAPI HTTP server in Go with Swagger endpoints definition
func NewHelloAPI ¶
NewHelloAPI creates a new Hello instance
func (*HelloAPI) AddMiddlewareFor ¶
func (o *HelloAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*HelloAPI) AuthenticatorsFor ¶
func (o *HelloAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*HelloAPI) Authorizer ¶
func (o *HelloAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*HelloAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*HelloAPI) Context ¶
func (o *HelloAPI) Context() *middleware.Context
Context returns the middleware context for the hello API
func (*HelloAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*HelloAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*HelloAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*HelloAPI) Init ¶
func (o *HelloAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*HelloAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*HelloAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*HelloAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*HelloAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*HelloAPI) Serve ¶
func (o *HelloAPI) 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 (*HelloAPI) ServeErrorFor ¶
func (o *HelloAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*HelloAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*HelloAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
Source Files ¶
- check_health.go
- check_health_parameters.go
- check_health_responses.go
- check_health_urlbuilder.go
- get_hello_user.go
- get_hello_user_parameters.go
- get_hello_user_responses.go
- get_hello_user_urlbuilder.go
- get_oops_user.go
- get_oops_user_parameters.go
- get_oops_user_responses.go
- get_oops_user_urlbuilder.go
- hello_api.go