operations

package
v0.0.0-...-dcf5433 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DfaAPI

type DfaAPI struct {
	Middleware func(middleware.Builder) http.Handler
	// JSONConsumer registers a consumer for a "application/dfa.api.v1+json" mime type
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for a "application/dfa.api.v1+json" mime type
	JSONProducer runtime.Producer

	// SecurityHeaderAuth 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
	SecurityHeaderAuth func(string) (*models.Principal, error)

	// SecurityQueryAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key token provided in the query
	SecurityQueryAuth func(string) (*models.Principal, error)

	// GeometryGetConvexHullHandler sets the operation handler for the get convex hull operation
	GeometryGetConvexHullHandler geometry.GetConvexHullHandler
	// RootVersionHandler sets the operation handler for the version operation
	RootVersionHandler root.VersionHandler

	// 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
}

DfaAPI Provides geometry, combinatorics, integer programming, functional simulation, and other domain flow algorithm analysis services

func NewDfaAPI

func NewDfaAPI(spec *loads.Document) *DfaAPI

NewDfaAPI creates a new Dfa instance

func (*DfaAPI) AuthenticatorsFor

func (o *DfaAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*DfaAPI) ConsumersFor

func (o *DfaAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types

func (*DfaAPI) Context

func (o *DfaAPI) Context() *middleware.Context

Context returns the middleware context for the dfa API

func (*DfaAPI) DefaultConsumes

func (o *DfaAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*DfaAPI) DefaultProduces

func (o *DfaAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*DfaAPI) Formats

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

Formats returns the registered string formats

func (*DfaAPI) HandlerFor

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

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

func (*DfaAPI) Init

func (o *DfaAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit

func (*DfaAPI) ProducersFor

func (o *DfaAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types

func (*DfaAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*DfaAPI) Serve

func (o *DfaAPI) 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 (*DfaAPI) ServeErrorFor

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

ServeErrorFor gets a error handler for a given operation id

func (*DfaAPI) SetDefaultConsumes

func (o *DfaAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*DfaAPI) SetDefaultProduces

func (o *DfaAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*DfaAPI) SetSpec

func (o *DfaAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*DfaAPI) Validate

func (o *DfaAPI) Validate() error

Validate validates the registrations in the DfaAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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