operations

package
v0.0.0-...-7a013b9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KazanAPI

type KazanAPI 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

	// OrderDeleteOrderIDHandler sets the operation handler for the delete order ID operation
	OrderDeleteOrderIDHandler order.DeleteOrderIDHandler
	// CouponGetCouponIDHandler sets the operation handler for the get coupon ID operation
	CouponGetCouponIDHandler coupon.GetCouponIDHandler
	// OrderGetOrderIDHandler sets the operation handler for the get order ID operation
	OrderGetOrderIDHandler order.GetOrderIDHandler
	// RouteGetRouteTicketIDHandler sets the operation handler for the get route ticket ID operation
	RouteGetRouteTicketIDHandler route.GetRouteTicketIDHandler
	// RouteGetRouteTrainIDHandler sets the operation handler for the get route train ID operation
	RouteGetRouteTrainIDHandler route.GetRouteTrainIDHandler
	// OrderPostOrderHandler sets the operation handler for the post order operation
	OrderPostOrderHandler order.PostOrderHandler
	// PaymentPutPayHandler sets the operation handler for the put pay operation
	PaymentPutPayHandler payment.PutPayHandler

	// 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
}

KazanAPI Kazan hackathon API

func NewKazanAPI

func NewKazanAPI(spec *loads.Document) *KazanAPI

NewKazanAPI creates a new Kazan instance

func (*KazanAPI) AuthenticatorsFor

func (o *KazanAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*KazanAPI) Authorizer

func (o *KazanAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*KazanAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*KazanAPI) Context

func (o *KazanAPI) Context() *middleware.Context

Context returns the middleware context for the kazan API

func (*KazanAPI) DefaultConsumes

func (o *KazanAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*KazanAPI) DefaultProduces

func (o *KazanAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*KazanAPI) Formats

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

Formats returns the registered string formats

func (*KazanAPI) HandlerFor

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

HandlerFor gets a http.Handler for the provided operation method and path

func (*KazanAPI) Init

func (o *KazanAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit

func (*KazanAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*KazanAPI) RegisterConsumer

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

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

func (*KazanAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*KazanAPI) RegisterProducer

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

RegisterProducer allows you to add (or override) a producer for a media type.

func (*KazanAPI) Serve

func (o *KazanAPI) 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 (*KazanAPI) ServeErrorFor

func (o *KazanAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*KazanAPI) SetDefaultConsumes

func (o *KazanAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*KazanAPI) SetDefaultProduces

func (o *KazanAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*KazanAPI) SetSpec

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

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

func (*KazanAPI) Validate

func (o *KazanAPI) Validate() error

Validate validates the registrations in the KazanAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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