Documentation
¶
Index ¶
- type LosAPI
- func (o *LosAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *LosAPI) Authorizer() runtime.Authorizer
- func (o *LosAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *LosAPI) Context() *middleware.Context
- func (o *LosAPI) DefaultConsumes() string
- func (o *LosAPI) DefaultProduces() string
- func (o *LosAPI) Formats() strfmt.Registry
- func (o *LosAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *LosAPI) Init()
- func (o *LosAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *LosAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *LosAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *LosAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *LosAPI) Serve(builder middleware.Builder) http.Handler
- func (o *LosAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *LosAPI) SetDefaultConsumes(mediaType string)
- func (o *LosAPI) SetDefaultProduces(mediaType string)
- func (o *LosAPI) SetSpec(spec *loads.Document)
- func (o *LosAPI) Validate() error
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 (*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 ¶
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 ¶
DefaultConsumes returns the default consumes media type
func (*LosAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*LosAPI) HandlerFor ¶
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 ¶
ProducersFor gets the producers for the specified media types
func (*LosAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*LosAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*LosAPI) RegisterProducer ¶
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 ¶
ServeErrorFor gets a error handler for a given operation id
func (*LosAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*LosAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type