operations

package
v0.0.0-...-e56e09a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 18 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnNetworkAPI

type OnNetworkAPI 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

	// JSONProducer registers a producer for a "application/json" mime type
	JSONProducer runtime.Producer

	// 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) (interface{}, error)

	// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
	APIAuthorizer runtime.Authorizer

	// AuthPostLoginHandler sets the operation handler for the post login operation
	AuthPostLoginHandler auth.PostLoginHandler
	// AboutAboutGetHandler sets the operation handler for the about get operation
	AboutAboutGetHandler about.AboutGetHandler
	// CheckVlanCheckVlanHandler sets the operation handler for the check vlan operation
	CheckVlanCheckVlanHandler check_vlan.CheckVlanHandler
	// SwitchConfigSwitchConfigHandler sets the operation handler for the switch config operation
	SwitchConfigSwitchConfigHandler switch_config.SwitchConfigHandler
	// SwitchFirmwareSwitchFirmwareHandler sets the operation handler for the switch firmware operation
	SwitchFirmwareSwitchFirmwareHandler switch_firmware.SwitchFirmwareHandler
	// SwitchVersionSwitchVersionHandler sets the operation handler for the switch version operation
	SwitchVersionSwitchVersionHandler switch_version.SwitchVersionHandler
	// UpdateSwitchUpdateSwitchHandler sets the operation handler for the update switch operation
	UpdateSwitchUpdateSwitchHandler update_switch.UpdateSwitchHandler

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

OnNetworkAPI the on network API

func NewOnNetworkAPI

func NewOnNetworkAPI(spec *loads.Document) *OnNetworkAPI

NewOnNetworkAPI creates a new OnNetwork instance

func (*OnNetworkAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*OnNetworkAPI) Authorizer

func (o *OnNetworkAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*OnNetworkAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*OnNetworkAPI) Context

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

Context returns the middleware context for the on network API

func (*OnNetworkAPI) DefaultConsumes

func (o *OnNetworkAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*OnNetworkAPI) DefaultProduces

func (o *OnNetworkAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*OnNetworkAPI) Formats

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

Formats returns the registered string formats

func (*OnNetworkAPI) HandlerFor

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

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

func (*OnNetworkAPI) Init

func (o *OnNetworkAPI) Init()

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

func (*OnNetworkAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*OnNetworkAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*OnNetworkAPI) Serve

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

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

ServeErrorFor gets a error handler for a given operation id

func (*OnNetworkAPI) SetDefaultConsumes

func (o *OnNetworkAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*OnNetworkAPI) SetDefaultProduces

func (o *OnNetworkAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*OnNetworkAPI) SetSpec

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

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

func (*OnNetworkAPI) Validate

func (o *OnNetworkAPI) Validate() error

Validate validates the registrations in the OnNetworkAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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