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 GetGopher
- type GetGopherHandler
- type GetGopherHandlerFunc
- type GetGopherOK
- type GetGopherParams
- type GetGopherURL
- func (o *GetGopherURL) Build() (*url.URL, error)
- func (o *GetGopherURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetGopherURL) Must(u *url.URL, err error) *url.URL
- func (o *GetGopherURL) SetBasePath(bp string)
- func (o *GetGopherURL) String() string
- func (o *GetGopherURL) StringFull(scheme, host string) string
- func (o *GetGopherURL) WithBasePath(bp string) *GetGopherURL
- 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 HelloAPIAPI
- func (o *HelloAPIAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *HelloAPIAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *HelloAPIAPI) Authorizer() runtime.Authorizer
- func (o *HelloAPIAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *HelloAPIAPI) Context() *middleware.Context
- func (o *HelloAPIAPI) DefaultConsumes() string
- func (o *HelloAPIAPI) DefaultProduces() string
- func (o *HelloAPIAPI) Formats() strfmt.Registry
- func (o *HelloAPIAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *HelloAPIAPI) Init()
- func (o *HelloAPIAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *HelloAPIAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *HelloAPIAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *HelloAPIAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *HelloAPIAPI) Serve(builder middleware.Builder) http.Handler
- func (o *HelloAPIAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *HelloAPIAPI) SetDefaultConsumes(mediaType string)
- func (o *HelloAPIAPI) SetDefaultProduces(mediaType string)
- func (o *HelloAPIAPI) SetSpec(spec *loads.Document)
- func (o *HelloAPIAPI) UseRedoc()
- func (o *HelloAPIAPI) UseSwaggerUI()
- func (o *HelloAPIAPI) Validate() error
Constants ¶
const CheckHealthOKCode int = 200
CheckHealthOKCode is the HTTP code returned for type CheckHealthOK
const GetGopherOKCode int = 200
GetGopherOKCode is the HTTP code returned for type GetGopherOK
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
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
There are no default values defined in the 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 GetGopher ¶
type GetGopher struct { Context *middleware.Context Handler GetGopherHandler }
GetGopher swagger:route GET /gopher/ getGopher
Return the Gopher Image.
func NewGetGopher ¶
func NewGetGopher(ctx *middleware.Context, handler GetGopherHandler) *GetGopher
NewGetGopher creates a new http.Handler for the get gopher operation
type GetGopherHandler ¶
type GetGopherHandler interface {
Handle(GetGopherParams) middleware.Responder
}
GetGopherHandler interface for that can handle valid get gopher params
type GetGopherHandlerFunc ¶
type GetGopherHandlerFunc func(GetGopherParams) middleware.Responder
GetGopherHandlerFunc turns a function with the right signature into a get gopher handler
func (GetGopherHandlerFunc) Handle ¶
func (fn GetGopherHandlerFunc) Handle(params GetGopherParams) middleware.Responder
Handle executing the request and returning a response
type GetGopherOK ¶
type GetGopherOK struct { /* In: Body */ Payload io.ReadCloser `json:"body,omitempty"` }
GetGopherOK Returns the Gopher.
swagger:response getGopherOK
func NewGetGopherOK ¶
func NewGetGopherOK() *GetGopherOK
NewGetGopherOK creates GetGopherOK with default headers values
func (*GetGopherOK) SetPayload ¶
func (o *GetGopherOK) SetPayload(payload io.ReadCloser)
SetPayload sets the payload to the get gopher o k response
func (*GetGopherOK) WithPayload ¶
func (o *GetGopherOK) WithPayload(payload io.ReadCloser) *GetGopherOK
WithPayload adds the payload to the get gopher o k response
func (*GetGopherOK) WriteResponse ¶
func (o *GetGopherOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetGopherParams ¶
type GetGopherParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*The name of the Gopher to display. In: query */ Name *string }
GetGopherParams contains all the bound params for the get gopher operation typically these are obtained from a http.Request
swagger:parameters GetGopher
func NewGetGopherParams ¶
func NewGetGopherParams() GetGopherParams
NewGetGopherParams creates a new GetGopherParams object
There are no default values defined in the spec.
func (*GetGopherParams) BindRequest ¶
func (o *GetGopherParams) 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 NewGetGopherParams() beforehand.
type GetGopherURL ¶
type GetGopherURL struct { Name *string // contains filtered or unexported fields }
GetGopherURL generates an URL for the get gopher operation
func (*GetGopherURL) Build ¶
func (o *GetGopherURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetGopherURL) BuildFull ¶
func (o *GetGopherURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetGopherURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetGopherURL) SetBasePath ¶
func (o *GetGopherURL) 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 (*GetGopherURL) String ¶
func (o *GetGopherURL) String() string
String returns the string representation of the path with query string
func (*GetGopherURL) StringFull ¶
func (o *GetGopherURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetGopherURL) WithBasePath ¶
func (o *GetGopherURL) WithBasePath(bp string) *GetGopherURL
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
There are no default values defined in the 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 HelloAPIAPI ¶
type HelloAPIAPI 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 // BinProducer registers a producer for the following mime types: // - image/png BinProducer runtime.Producer // 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 // GetGopherHandler sets the operation handler for the get gopher operation GetGopherHandler GetGopherHandler // GetHelloUserHandler sets the operation handler for the get hello user operation GetHelloUserHandler GetHelloUserHandler // 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 }
HelloAPIAPI HTTP server in Go with Swagger endpoints definition.
func NewHelloAPIAPI ¶
func NewHelloAPIAPI(spec *loads.Document) *HelloAPIAPI
NewHelloAPIAPI creates a new HelloAPI instance
func (*HelloAPIAPI) AddMiddlewareFor ¶
func (o *HelloAPIAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*HelloAPIAPI) AuthenticatorsFor ¶
func (o *HelloAPIAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*HelloAPIAPI) Authorizer ¶
func (o *HelloAPIAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*HelloAPIAPI) ConsumersFor ¶
func (o *HelloAPIAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*HelloAPIAPI) Context ¶
func (o *HelloAPIAPI) Context() *middleware.Context
Context returns the middleware context for the hello API API
func (*HelloAPIAPI) DefaultConsumes ¶
func (o *HelloAPIAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*HelloAPIAPI) DefaultProduces ¶
func (o *HelloAPIAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*HelloAPIAPI) Formats ¶
func (o *HelloAPIAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*HelloAPIAPI) HandlerFor ¶
func (o *HelloAPIAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*HelloAPIAPI) Init ¶
func (o *HelloAPIAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*HelloAPIAPI) ProducersFor ¶
func (o *HelloAPIAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*HelloAPIAPI) RegisterConsumer ¶
func (o *HelloAPIAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*HelloAPIAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*HelloAPIAPI) RegisterProducer ¶
func (o *HelloAPIAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*HelloAPIAPI) Serve ¶
func (o *HelloAPIAPI) 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 (*HelloAPIAPI) ServeErrorFor ¶
func (o *HelloAPIAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*HelloAPIAPI) SetDefaultConsumes ¶
func (o *HelloAPIAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*HelloAPIAPI) SetDefaultProduces ¶
func (o *HelloAPIAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*HelloAPIAPI) SetSpec ¶
func (o *HelloAPIAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*HelloAPIAPI) UseSwaggerUI ¶
func (o *HelloAPIAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*HelloAPIAPI) Validate ¶
func (o *HelloAPIAPI) Validate() error
Validate validates the registrations in the HelloAPIAPI
Source Files ¶
- check_health.go
- check_health_parameters.go
- check_health_responses.go
- check_health_urlbuilder.go
- get_gopher.go
- get_gopher_parameters.go
- get_gopher_responses.go
- get_gopher_urlbuilder.go
- get_hello_user.go
- get_hello_user_parameters.go
- get_hello_user_responses.go
- get_hello_user_urlbuilder.go
- hello_api_api.go