operations

package
v0.0.0-...-86e536e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LosAPI

type LosAPI struct {
	Middleware func(middleware.Builder) http.Handler

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implemention 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 implemention 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 implemention 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
	// HTMLProducer registers a producer for a "text/html" mime type
	HTMLProducer runtime.Producer

	// LosAuthAuth registers a function that takes an access token and a collection of required scopes and returns a principal
	// it performs authentication based on an oauth2 bearer token provided in the request
	LosAuthAuth func(string, []string) (*models.Principal, error)

	// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
	APIAuthorizer runtime.Authorizer

	// CompetitionCreateCompetitionHandler sets the operation handler for the create competition operation
	CompetitionCreateCompetitionHandler competition.CreateCompetitionHandler
	// UserCreateUserHandler sets the operation handler for the create user operation
	UserCreateUserHandler user.CreateUserHandler
	// CompetitionDeleteCompetitionHandler sets the operation handler for the delete competition operation
	CompetitionDeleteCompetitionHandler competition.DeleteCompetitionHandler
	// UserDeleteUserHandler sets the operation handler for the delete user operation
	UserDeleteUserHandler user.DeleteUserHandler
	// CompetitionGetCompetitionByIDHandler sets the operation handler for the get competition by Id operation
	CompetitionGetCompetitionByIDHandler competition.GetCompetitionByIDHandler
	// CompetitionGetCompetitionsHandler sets the operation handler for the get competitions operation
	CompetitionGetCompetitionsHandler competition.GetCompetitionsHandler
	// CompetitionGetCompetitionsHTMLHandler sets the operation handler for the get competitions Html operation
	CompetitionGetCompetitionsHTMLHandler competition.GetCompetitionsHTMLHandler
	// RangeOperationsGetRangeByIDHandler sets the operation handler for the get range by Id operation
	RangeOperationsGetRangeByIDHandler range_operations.GetRangeByIDHandler
	// RangeOperationsGetRangesHandler sets the operation handler for the get ranges operation
	RangeOperationsGetRangesHandler range_operations.GetRangesHandler
	// RangeOperationsGetRangesHTMLHandler sets the operation handler for the get ranges Html operation
	RangeOperationsGetRangesHTMLHandler range_operations.GetRangesHTMLHandler
	// UserGetUserByNameHandler sets the operation handler for the get user by name operation
	UserGetUserByNameHandler user.GetUserByNameHandler
	// LoginLoginUserHandler sets the operation handler for the login user operation
	LoginLoginUserHandler login.LoginUserHandler
	// LoginLogoutUserHandler sets the operation handler for the logout user operation
	LoginLogoutUserHandler login.LogoutUserHandler
	// LoginRefreshTokenHandler sets the operation handler for the refresh token operation
	LoginRefreshTokenHandler login.RefreshTokenHandler
	// CompetitionUpdateCompetitonHandler sets the operation handler for the update competiton operation
	CompetitionUpdateCompetitonHandler competition.UpdateCompetitonHandler
	// UserUpdateUserHandler sets the operation handler for the update user operation
	UserUpdateUserHandler user.UpdateUserHandler

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

LosAPI This is a data server for LOS shooting competition.

func NewLosAPI

func NewLosAPI(spec *loads.Document) *LosAPI

NewLosAPI creates a new Los instance

func (*LosAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*LosAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*LosAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*LosAPI) Context

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

Context returns the middleware context for the los API

func (*LosAPI) DefaultConsumes

func (o *LosAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*LosAPI) DefaultProduces

func (o *LosAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*LosAPI) Formats

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

Formats returns the registered string formats

func (*LosAPI) HandlerFor

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

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

func (*LosAPI) Init

func (o *LosAPI) Init()

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

func (*LosAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*LosAPI) RegisterConsumer

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

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

func (*LosAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*LosAPI) RegisterProducer

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

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

func (*LosAPI) Serve

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

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

ServeErrorFor gets a error handler for a given operation id

func (*LosAPI) SetDefaultConsumes

func (o *LosAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*LosAPI) SetDefaultProduces

func (o *LosAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*LosAPI) SetSpec

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

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

func (*LosAPI) Validate

func (o *LosAPI) Validate() error

Validate validates the registrations in the LosAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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