operations

package
v0.0.0-...-299512e Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

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

type OptionsAllowParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`
}

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

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

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

func NewPreisAPI(spec *loads.Document) *PreisAPI

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

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

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

func (o *PreisAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*PreisAPI) DefaultProduces

func (o *PreisAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*PreisAPI) Formats

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

Formats returns the registered string formats

func (*PreisAPI) HandlerFor

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

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

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

ProducersFor gets the producers for the specified media types

func (*PreisAPI) RegisterConsumer

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

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

func (*PreisAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*PreisAPI) RegisterProducer

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

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

func (o *PreisAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*PreisAPI) SetDefaultProduces

func (o *PreisAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*PreisAPI) SetSpec

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

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

func (*PreisAPI) Validate

func (o *PreisAPI) Validate() error

Validate validates the registrations in the PreisAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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