Documentation ¶
Index ¶
- type KvstoreAPI
- func (o *KvstoreAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *KvstoreAPI) Authorizer() runtime.Authorizer
- func (o *KvstoreAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *KvstoreAPI) Context() *middleware.Context
- func (o *KvstoreAPI) DefaultConsumes() string
- func (o *KvstoreAPI) DefaultProduces() string
- func (o *KvstoreAPI) Formats() strfmt.Registry
- func (o *KvstoreAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *KvstoreAPI) Init()
- func (o *KvstoreAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *KvstoreAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *KvstoreAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *KvstoreAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *KvstoreAPI) Serve(builder middleware.Builder) http.Handler
- func (o *KvstoreAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *KvstoreAPI) SetDefaultConsumes(mediaType string)
- func (o *KvstoreAPI) SetDefaultProduces(mediaType string)
- func (o *KvstoreAPI) SetSpec(spec *loads.Document)
- func (o *KvstoreAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KvstoreAPI ¶
type KvstoreAPI 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 // BinConsumer registers a consumer for a "application/octet-stream" mime type BinConsumer runtime.Consumer // JSONProducer registers a producer for a "application/json" mime type JSONProducer runtime.Producer // BinProducer registers a producer for a "application/octet-stream" mime type BinProducer runtime.Producer // KvDeleteEntryHandler sets the operation handler for the delete entry operation KvDeleteEntryHandler kv.DeleteEntryHandler // KvFindKeysHandler sets the operation handler for the find keys operation KvFindKeysHandler kv.FindKeysHandler // KvGetEntryHandler sets the operation handler for the get entry operation KvGetEntryHandler kv.GetEntryHandler // KvPutEntryHandler sets the operation handler for the put entry operation KvPutEntryHandler kv.PutEntryHandler // 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 }
KvstoreAPI K/V store is a simple single node store for retrieving key/value information
func NewKvstoreAPI ¶
func NewKvstoreAPI(spec *loads.Document) *KvstoreAPI
NewKvstoreAPI creates a new Kvstore instance
func (*KvstoreAPI) AuthenticatorsFor ¶
func (o *KvstoreAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*KvstoreAPI) Authorizer ¶
func (o *KvstoreAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*KvstoreAPI) ConsumersFor ¶
func (o *KvstoreAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types
func (*KvstoreAPI) Context ¶
func (o *KvstoreAPI) Context() *middleware.Context
Context returns the middleware context for the kvstore API
func (*KvstoreAPI) DefaultConsumes ¶
func (o *KvstoreAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*KvstoreAPI) DefaultProduces ¶
func (o *KvstoreAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*KvstoreAPI) Formats ¶
func (o *KvstoreAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*KvstoreAPI) HandlerFor ¶
func (o *KvstoreAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*KvstoreAPI) Init ¶
func (o *KvstoreAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*KvstoreAPI) ProducersFor ¶
func (o *KvstoreAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types
func (*KvstoreAPI) RegisterConsumer ¶
func (o *KvstoreAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*KvstoreAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*KvstoreAPI) RegisterProducer ¶
func (o *KvstoreAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*KvstoreAPI) Serve ¶
func (o *KvstoreAPI) 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 (*KvstoreAPI) ServeErrorFor ¶
func (o *KvstoreAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*KvstoreAPI) SetDefaultConsumes ¶
func (o *KvstoreAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*KvstoreAPI) SetDefaultProduces ¶
func (o *KvstoreAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*KvstoreAPI) SetSpec ¶
func (o *KvstoreAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*KvstoreAPI) Validate ¶
func (o *KvstoreAPI) Validate() error
Validate validates the registrations in the KvstoreAPI