Documentation ¶
Index ¶
- type SomesimAPI
- func (o *SomesimAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *SomesimAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *SomesimAPI) Context() *middleware.Context
- func (o *SomesimAPI) DefaultConsumes() string
- func (o *SomesimAPI) DefaultProduces() string
- func (o *SomesimAPI) Formats() strfmt.Registry
- func (o *SomesimAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *SomesimAPI) Init()
- func (o *SomesimAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *SomesimAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *SomesimAPI) Serve(builder middleware.Builder) http.Handler
- func (o *SomesimAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *SomesimAPI) SetDefaultConsumes(mediaType string)
- func (o *SomesimAPI) SetDefaultProduces(mediaType string)
- func (o *SomesimAPI) SetSpec(spec *loads.Document)
- func (o *SomesimAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SomesimAPI ¶
type SomesimAPI struct { Middleware func(middleware.Builder) http.Handler // 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 // TxtProducer registers a producer for a "text/plain" mime type TxtProducer runtime.Producer // BasicAuthAuth registers a function that takes username and password and returns a principal // it performs authentication with basic auth BasicAuthAuth func(string, string) (*models.Principal, error) // BearerAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key Authorization provided in the header BearerAuth func(string) (*models.Principal, error) // InternalAPIGetDocsHandler sets the operation handler for the get docs operation InternalAPIGetDocsHandler internal_api.GetDocsHandler // InternalAPIGetDocsSwaggerYmlHandler sets the operation handler for the get docs swagger yml operation InternalAPIGetDocsSwaggerYmlHandler internal_api.GetDocsSwaggerYmlHandler // FlowerGetFlowersHandler sets the operation handler for the get flowers operation FlowerGetFlowersHandler flower.GetFlowersHandler // FlowerGetFlowersNameHandler sets the operation handler for the get flowers name operation FlowerGetFlowersNameHandler flower.GetFlowersNameHandler // ItemGetItemsHandler sets the operation handler for the get items operation ItemGetItemsHandler item.GetItemsHandler // ItemGetItemsNameHandler sets the operation handler for the get items name operation ItemGetItemsNameHandler item.GetItemsNameHandler // ItemGetItemsNameImagesHandler sets the operation handler for the get items name images operation ItemGetItemsNameImagesHandler item.GetItemsNameImagesHandler // ItemGetItemsNameImagesImageNameHandler sets the operation handler for the get items name images image name operation ItemGetItemsNameImagesImageNameHandler item.GetItemsNameImagesImageNameHandler // UserGetTokensHandler sets the operation handler for the get tokens operation UserGetTokensHandler user.GetTokensHandler // UserGetTokensAccessTokenHandler sets the operation handler for the get tokens access token operation UserGetTokensAccessTokenHandler user.GetTokensAccessTokenHandler // FlowerPostFlowersHandler sets the operation handler for the post flowers operation FlowerPostFlowersHandler flower.PostFlowersHandler // ItemPostItemsHandler sets the operation handler for the post items operation ItemPostItemsHandler item.PostItemsHandler // ItemPostItemsNameImagesHandler sets the operation handler for the post items name images operation ItemPostItemsNameImagesHandler item.PostItemsNameImagesHandler // FlowerPutFlowersNameHandler sets the operation handler for the put flowers name operation FlowerPutFlowersNameHandler flower.PutFlowersNameHandler // ItemPutItemsNameHandler sets the operation handler for the put items name operation ItemPutItemsNameHandler item.PutItemsNameHandler // ItemPutItemsNameImagesImageNameHandler sets the operation handler for the put items name images image name operation ItemPutItemsNameImagesImageNameHandler item.PutItemsNameImagesImageNameHandler // 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 }
SomesimAPI # 概要 MoE用染色シミュレータ「そめしむ」のバックエンドAPI.
func NewSomesimAPI ¶
func NewSomesimAPI(spec *loads.Document) *SomesimAPI
NewSomesimAPI creates a new Somesim instance
func (*SomesimAPI) AuthenticatorsFor ¶
func (o *SomesimAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*SomesimAPI) ConsumersFor ¶
func (o *SomesimAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types
func (*SomesimAPI) Context ¶
func (o *SomesimAPI) Context() *middleware.Context
Context returns the middleware context for the somesim API
func (*SomesimAPI) DefaultConsumes ¶
func (o *SomesimAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*SomesimAPI) DefaultProduces ¶
func (o *SomesimAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*SomesimAPI) Formats ¶
func (o *SomesimAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*SomesimAPI) HandlerFor ¶
func (o *SomesimAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*SomesimAPI) Init ¶
func (o *SomesimAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit
func (*SomesimAPI) ProducersFor ¶
func (o *SomesimAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types
func (*SomesimAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*SomesimAPI) Serve ¶
func (o *SomesimAPI) 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 (*SomesimAPI) ServeErrorFor ¶
func (o *SomesimAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*SomesimAPI) SetDefaultConsumes ¶
func (o *SomesimAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*SomesimAPI) SetDefaultProduces ¶
func (o *SomesimAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*SomesimAPI) SetSpec ¶
func (o *SomesimAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*SomesimAPI) Validate ¶
func (o *SomesimAPI) Validate() error
Validate validates the registrations in the SomesimAPI