operations

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleToDoListAPI added in v0.2.0

type SimpleToDoListAPI struct {

	// JSONConsumer registers a consumer for a "application/io.swagger.examples.todo-list.v1+json" mime type
	JSONConsumer httpkit.Consumer

	// JSONProducer registers a producer for a "application/io.swagger.examples.todo-list.v1+json" mime type
	JSONProducer httpkit.Producer

	// KeyAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key x-petstore-token provided in the header
	KeyAuth func(string) (interface{}, error)

	// TodosAddOneHandler sets the operation handler for the add one operation
	TodosAddOneHandler todos.AddOneHandler
	// TodosDestroyOneHandler sets the operation handler for the destroy one operation
	TodosDestroyOneHandler todos.DestroyOneHandler
	// TodosFindHandler sets the operation handler for the find operation
	TodosFindHandler todos.FindHandler
	// TodosUpdateOneHandler sets the operation handler for the update one operation
	TodosUpdateOneHandler todos.UpdateOneHandler

	// 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)
	// contains filtered or unexported fields
}

SimpleToDoListAPI the simple to do list API

func NewSimpleToDoListAPI added in v0.2.0

func NewSimpleToDoListAPI(spec *spec.Document) *SimpleToDoListAPI

NewSimpleToDoListAPI creates a new SimpleToDoList instance

func (*SimpleToDoListAPI) AuthenticatorsFor added in v0.2.0

func (o *SimpleToDoListAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]httpkit.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*SimpleToDoListAPI) ConsumersFor added in v0.2.0

func (o *SimpleToDoListAPI) ConsumersFor(mediaTypes []string) map[string]httpkit.Consumer

ConsumersFor gets the consumers for the specified media types

func (*SimpleToDoListAPI) DefaultConsumes added in v0.2.0

func (o *SimpleToDoListAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*SimpleToDoListAPI) DefaultProduces added in v0.2.0

func (o *SimpleToDoListAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*SimpleToDoListAPI) Formats added in v0.2.0

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

Formats returns the registered string formats

func (*SimpleToDoListAPI) HandlerFor added in v0.2.0

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

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

func (*SimpleToDoListAPI) ProducersFor added in v0.2.0

func (o *SimpleToDoListAPI) ProducersFor(mediaTypes []string) map[string]httpkit.Producer

ProducersFor gets the producers for the specified media types

func (*SimpleToDoListAPI) RegisterFormat added in v0.2.0

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

RegisterFormat registers a custom format validator

func (*SimpleToDoListAPI) Serve added in v0.2.0

func (o *SimpleToDoListAPI) 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 (*SimpleToDoListAPI) ServeErrorFor added in v0.2.0

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

ServeErrorFor gets a error handler for a given operation id

func (*SimpleToDoListAPI) SetDefaultConsumes added in v0.2.0

func (o *SimpleToDoListAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*SimpleToDoListAPI) SetDefaultProduces added in v0.2.0

func (o *SimpleToDoListAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*SimpleToDoListAPI) Validate added in v0.2.0

func (o *SimpleToDoListAPI) Validate() error

Validate validates the registrations in the SimpleToDoListAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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