Documentation ¶
Index ¶
- type HtaAPI
- func (o *HtaAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *HtaAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *HtaAPI) Authorizer() runtime.Authorizer
- func (o *HtaAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *HtaAPI) Context() *middleware.Context
- func (o *HtaAPI) DefaultConsumes() string
- func (o *HtaAPI) DefaultProduces() string
- func (o *HtaAPI) Formats() strfmt.Registry
- func (o *HtaAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *HtaAPI) Init()
- func (o *HtaAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *HtaAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *HtaAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *HtaAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *HtaAPI) Serve(builder middleware.Builder) http.Handler
- func (o *HtaAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *HtaAPI) SetDefaultConsumes(mediaType string)
- func (o *HtaAPI) SetDefaultProduces(mediaType string)
- func (o *HtaAPI) SetSpec(spec *loads.Document)
- func (o *HtaAPI) UseRedoc()
- func (o *HtaAPI) UseSwaggerUI()
- func (o *HtaAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HtaAPI ¶
type HtaAPI 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 the following mime types: // - application/json JSONConsumer runtime.Consumer // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer // BearerTokenAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key x-token provided in the header BearerTokenAuth func(string) (*schemas.User, error) // OauthSecurityAuth 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 OauthSecurityAuth func(string, []string) (*schemas.User, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // CategoryDeleteCategoryIDHandler sets the operation handler for the delete category ID operation CategoryDeleteCategoryIDHandler category.DeleteCategoryIDHandler // EntryDeleteEntriesIDHandler sets the operation handler for the delete entries ID operation EntryDeleteEntriesIDHandler entry.DeleteEntriesIDHandler // CategoryDeleteMultiChoiceIDHandler sets the operation handler for the delete multi choice ID operation CategoryDeleteMultiChoiceIDHandler category.DeleteMultiChoiceIDHandler // CategoryDeleteSingleChoiceGroupIDHandler sets the operation handler for the delete single choice group ID operation CategoryDeleteSingleChoiceGroupIDHandler category.DeleteSingleChoiceGroupIDHandler // CategoryDeleteSingleChoiceIDHandler sets the operation handler for the delete single choice ID operation CategoryDeleteSingleChoiceIDHandler category.DeleteSingleChoiceIDHandler // CategoryGetCategoryHandler sets the operation handler for the get category operation CategoryGetCategoryHandler category.GetCategoryHandler // CategoryGetCategoryCategoryIDMultiChoiceHandler sets the operation handler for the get category category ID multi choice operation CategoryGetCategoryCategoryIDMultiChoiceHandler category.GetCategoryCategoryIDMultiChoiceHandler // CategoryGetCategoryCategoryIDSingleChoiceGroupHandler sets the operation handler for the get category category ID single choice group operation CategoryGetCategoryCategoryIDSingleChoiceGroupHandler category.GetCategoryCategoryIDSingleChoiceGroupHandler // CategoryGetCategoryIDHandler sets the operation handler for the get category ID operation CategoryGetCategoryIDHandler category.GetCategoryIDHandler // EntryGetEntriesHandler sets the operation handler for the get entries operation EntryGetEntriesHandler entry.GetEntriesHandler // EntryGetEntriesIDHandler sets the operation handler for the get entries ID operation EntryGetEntriesIDHandler entry.GetEntriesIDHandler // CategoryGetMultiChoiceIDHandler sets the operation handler for the get multi choice ID operation CategoryGetMultiChoiceIDHandler category.GetMultiChoiceIDHandler // LoginGetOidcInfoHandler sets the operation handler for the get oidc info operation LoginGetOidcInfoHandler login.GetOidcInfoHandler // CategoryGetSingleChoiceGroupGroupIDSingleChoiceHandler sets the operation handler for the get single choice group group ID single choice operation CategoryGetSingleChoiceGroupGroupIDSingleChoiceHandler category.GetSingleChoiceGroupGroupIDSingleChoiceHandler // CategoryGetSingleChoiceGroupIDHandler sets the operation handler for the get single choice group ID operation CategoryGetSingleChoiceGroupIDHandler category.GetSingleChoiceGroupIDHandler // CategoryGetSingleChoiceIDHandler sets the operation handler for the get single choice ID operation CategoryGetSingleChoiceIDHandler category.GetSingleChoiceIDHandler // LoginGetUserHandler sets the operation handler for the get user operation LoginGetUserHandler login.GetUserHandler // CategoryPostCategoryHandler sets the operation handler for the post category operation CategoryPostCategoryHandler category.PostCategoryHandler // CategoryPostCategoryCategoryIDMultiChoiceHandler sets the operation handler for the post category category ID multi choice operation CategoryPostCategoryCategoryIDMultiChoiceHandler category.PostCategoryCategoryIDMultiChoiceHandler // CategoryPostCategoryCategoryIDSingleChoiceGroupHandler sets the operation handler for the post category category ID single choice group operation CategoryPostCategoryCategoryIDSingleChoiceGroupHandler category.PostCategoryCategoryIDSingleChoiceGroupHandler // EntryPostEntriesHandler sets the operation handler for the post entries operation EntryPostEntriesHandler entry.PostEntriesHandler // CategoryPostSingleChoiceGroupGroupIDSingleChoiceHandler sets the operation handler for the post single choice group group ID single choice operation CategoryPostSingleChoiceGroupGroupIDSingleChoiceHandler category.PostSingleChoiceGroupGroupIDSingleChoiceHandler // CategoryPutCategoryIDHandler sets the operation handler for the put category ID operation CategoryPutCategoryIDHandler category.PutCategoryIDHandler // EntryPutEntriesIDHandler sets the operation handler for the put entries ID operation EntryPutEntriesIDHandler entry.PutEntriesIDHandler // CategoryPutMultiChoiceIDHandler sets the operation handler for the put multi choice ID operation CategoryPutMultiChoiceIDHandler category.PutMultiChoiceIDHandler // CategoryPutSingleChoiceGroupIDHandler sets the operation handler for the put single choice group ID operation CategoryPutSingleChoiceGroupIDHandler category.PutSingleChoiceGroupIDHandler // CategoryPutSingleChoiceIDHandler sets the operation handler for the put single choice ID operation CategoryPutSingleChoiceIDHandler category.PutSingleChoiceIDHandler // 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) // PreServerShutdown is called before the HTTP(S) server is shutdown // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic PreServerShutdown func() // 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 }
HtaAPI Track Health Parameters
func (*HtaAPI) AddMiddlewareFor ¶
func (o *HtaAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*HtaAPI) AuthenticatorsFor ¶
func (o *HtaAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*HtaAPI) Authorizer ¶
func (o *HtaAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*HtaAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*HtaAPI) Context ¶
func (o *HtaAPI) Context() *middleware.Context
Context returns the middleware context for the hta API
func (*HtaAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*HtaAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*HtaAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*HtaAPI) Init ¶
func (o *HtaAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*HtaAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*HtaAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*HtaAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*HtaAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*HtaAPI) Serve ¶
func (o *HtaAPI) 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 (*HtaAPI) ServeErrorFor ¶
ServeErrorFor gets a error handler for a given operation id
func (*HtaAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*HtaAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
func (*HtaAPI) UseSwaggerUI ¶
func (o *HtaAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs