Documentation ¶
Index ¶
- Constants
- type OptionsAllow
- type OptionsAllowHandler
- type OptionsAllowHandlerFunc
- type OptionsAllowOK
- type OptionsAllowParams
- type OptionsAllowURL
- func (o *OptionsAllowURL) Build() (*url.URL, error)
- func (o *OptionsAllowURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *OptionsAllowURL) Must(u *url.URL, err error) *url.URL
- func (o *OptionsAllowURL) SetBasePath(bp string)
- func (o *OptionsAllowURL) String() string
- func (o *OptionsAllowURL) StringFull(scheme, host string) string
- func (o *OptionsAllowURL) WithBasePath(bp string) *OptionsAllowURL
- type PreisAPI
- func (o *PreisAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *PreisAPI) Authorizer() runtime.Authorizer
- func (o *PreisAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *PreisAPI) Context() *middleware.Context
- func (o *PreisAPI) DefaultConsumes() string
- func (o *PreisAPI) DefaultProduces() string
- func (o *PreisAPI) Formats() strfmt.Registry
- func (o *PreisAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *PreisAPI) Init()
- func (o *PreisAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *PreisAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *PreisAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *PreisAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *PreisAPI) Serve(builder middleware.Builder) http.Handler
- func (o *PreisAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *PreisAPI) SetDefaultConsumes(mediaType string)
- func (o *PreisAPI) SetDefaultProduces(mediaType string)
- func (o *PreisAPI) SetSpec(spec *loads.Document)
- func (o *PreisAPI) Validate() error
Constants ¶
const OptionsAllowOKCode int = 200
OptionsAllowOKCode is the HTTP code returned for type OptionsAllowOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionsAllow ¶
type OptionsAllow struct { Context *middleware.Context Handler OptionsAllowHandler }
OptionsAllow swagger:route OPTIONS /* optionsAllow
OptionsAllow options allow API
func NewOptionsAllow ¶
func NewOptionsAllow(ctx *middleware.Context, handler OptionsAllowHandler) *OptionsAllow
NewOptionsAllow creates a new http.Handler for the options allow operation
func (*OptionsAllow) ServeHTTP ¶
func (o *OptionsAllow) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type OptionsAllowHandler ¶
type OptionsAllowHandler interface {
Handle(OptionsAllowParams) middleware.Responder
}
OptionsAllowHandler interface for that can handle valid options allow params
type OptionsAllowHandlerFunc ¶
type OptionsAllowHandlerFunc func(OptionsAllowParams) middleware.Responder
OptionsAllowHandlerFunc turns a function with the right signature into a options allow handler
func (OptionsAllowHandlerFunc) Handle ¶
func (fn OptionsAllowHandlerFunc) Handle(params OptionsAllowParams) middleware.Responder
Handle executing the request and returning a response
type OptionsAllowOK ¶
type OptionsAllowOK struct { }
OptionsAllowOK Successful operation
swagger:response optionsAllowOK
func NewOptionsAllowOK ¶
func NewOptionsAllowOK() *OptionsAllowOK
NewOptionsAllowOK creates OptionsAllowOK with default headers values
func (*OptionsAllowOK) WriteResponse ¶
func (o *OptionsAllowOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type OptionsAllowParams ¶
OptionsAllowParams contains all the bound params for the options allow operation typically these are obtained from a http.Request
swagger:parameters optionsAllow
func NewOptionsAllowParams ¶
func NewOptionsAllowParams() OptionsAllowParams
NewOptionsAllowParams creates a new OptionsAllowParams object no default values defined in spec.
func (*OptionsAllowParams) BindRequest ¶
func (o *OptionsAllowParams) 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 NewOptionsAllowParams() beforehand.
type OptionsAllowURL ¶
type OptionsAllowURL struct {
// contains filtered or unexported fields
}
OptionsAllowURL generates an URL for the options allow operation
func (*OptionsAllowURL) Build ¶
func (o *OptionsAllowURL) Build() (*url.URL, error)
Build a url path and query string
func (*OptionsAllowURL) BuildFull ¶
func (o *OptionsAllowURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*OptionsAllowURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*OptionsAllowURL) SetBasePath ¶
func (o *OptionsAllowURL) 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 (*OptionsAllowURL) String ¶
func (o *OptionsAllowURL) String() string
String returns the string representation of the path with query string
func (*OptionsAllowURL) StringFull ¶
func (o *OptionsAllowURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*OptionsAllowURL) WithBasePath ¶
func (o *OptionsAllowURL) WithBasePath(bp string) *OptionsAllowURL
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 PreisAPI ¶
type PreisAPI 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 // PriceGetPriceHandler sets the operation handler for the get price operation PriceGetPriceHandler price.GetPriceHandler // OptionsAllowHandler sets the operation handler for the options allow operation OptionsAllowHandler OptionsAllowHandler // 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 }
PreisAPI This is the api POC
func NewPreisAPI ¶
NewPreisAPI creates a new Preis instance
func (*PreisAPI) AuthenticatorsFor ¶
func (o *PreisAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*PreisAPI) Authorizer ¶
func (o *PreisAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*PreisAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types
func (*PreisAPI) Context ¶
func (o *PreisAPI) Context() *middleware.Context
Context returns the middleware context for the preis API
func (*PreisAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*PreisAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*PreisAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*PreisAPI) Init ¶
func (o *PreisAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*PreisAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types
func (*PreisAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*PreisAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*PreisAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*PreisAPI) Serve ¶
func (o *PreisAPI) 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 (*PreisAPI) ServeErrorFor ¶
func (o *PreisAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*PreisAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*PreisAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type