operations

package
v0.0.0-...-1b308a6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KwskAPI

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

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

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

	// ActionsDeleteWebNamespacePackageNameActionNameExtensionHandler sets the operation handler for the delete web namespace package name action name extension operation
	ActionsDeleteWebNamespacePackageNameActionNameExtensionHandler actions.DeleteWebNamespacePackageNameActionNameExtensionHandler
	// ActivationsGetNamespacesNamespaceActivationsActivationidLogsHandler sets the operation handler for the get namespaces namespace activations activationid logs operation
	ActivationsGetNamespacesNamespaceActivationsActivationidLogsHandler activations.GetNamespacesNamespaceActivationsActivationidLogsHandler
	// ActivationsGetNamespacesNamespaceActivationsActivationidResultHandler sets the operation handler for the get namespaces namespace activations activationid result operation
	ActivationsGetNamespacesNamespaceActivationsActivationidResultHandler activations.GetNamespacesNamespaceActivationsActivationidResultHandler
	// ActionsGetWebNamespacePackageNameActionNameExtensionHandler sets the operation handler for the get web namespace package name action name extension operation
	ActionsGetWebNamespacePackageNameActionNameExtensionHandler actions.GetWebNamespacePackageNameActionNameExtensionHandler
	// ActionsPostWebNamespacePackageNameActionNameExtensionHandler sets the operation handler for the post web namespace package name action name extension operation
	ActionsPostWebNamespacePackageNameActionNameExtensionHandler actions.PostWebNamespacePackageNameActionNameExtensionHandler
	// ActionsPutWebNamespacePackageNameActionNameExtensionHandler sets the operation handler for the put web namespace package name action name extension operation
	ActionsPutWebNamespacePackageNameActionNameExtensionHandler actions.PutWebNamespacePackageNameActionNameExtensionHandler
	// ActionsDeleteActionHandler sets the operation handler for the delete action operation
	ActionsDeleteActionHandler actions.DeleteActionHandler
	// ActionsDeleteActionInPackageHandler sets the operation handler for the delete action in package operation
	ActionsDeleteActionInPackageHandler actions.DeleteActionInPackageHandler
	// PackagesDeletePackageHandler sets the operation handler for the delete package operation
	PackagesDeletePackageHandler packages.DeletePackageHandler
	// RulesDeleteRuleHandler sets the operation handler for the delete rule operation
	RulesDeleteRuleHandler rules.DeleteRuleHandler
	// TriggersDeleteTriggerHandler sets the operation handler for the delete trigger operation
	TriggersDeleteTriggerHandler triggers.DeleteTriggerHandler
	// TriggersFireTriggerHandler sets the operation handler for the fire trigger operation
	TriggersFireTriggerHandler triggers.FireTriggerHandler
	// ActionsGetActionByNameHandler sets the operation handler for the get action by name operation
	ActionsGetActionByNameHandler actions.GetActionByNameHandler
	// ActionsGetActionInPackageByNameHandler sets the operation handler for the get action in package by name operation
	ActionsGetActionInPackageByNameHandler actions.GetActionInPackageByNameHandler
	// ActivationsGetActivationByIDHandler sets the operation handler for the get activation by Id operation
	ActivationsGetActivationByIDHandler activations.GetActivationByIDHandler
	// ActivationsGetActivationsHandler sets the operation handler for the get activations operation
	ActivationsGetActivationsHandler activations.GetActivationsHandler
	// ActionsGetAllActionsHandler sets the operation handler for the get all actions operation
	ActionsGetAllActionsHandler actions.GetAllActionsHandler
	// NamespacesGetAllNamespacesHandler sets the operation handler for the get all namespaces operation
	NamespacesGetAllNamespacesHandler namespaces.GetAllNamespacesHandler
	// PackagesGetAllPackagesHandler sets the operation handler for the get all packages operation
	PackagesGetAllPackagesHandler packages.GetAllPackagesHandler
	// RulesGetAllRulesHandler sets the operation handler for the get all rules operation
	RulesGetAllRulesHandler rules.GetAllRulesHandler
	// TriggersGetAllTriggersHandler sets the operation handler for the get all triggers operation
	TriggersGetAllTriggersHandler triggers.GetAllTriggersHandler
	// PackagesGetPackageByNameHandler sets the operation handler for the get package by name operation
	PackagesGetPackageByNameHandler packages.GetPackageByNameHandler
	// RulesGetRuleByNameHandler sets the operation handler for the get rule by name operation
	RulesGetRuleByNameHandler rules.GetRuleByNameHandler
	// TriggersGetTriggerByNameHandler sets the operation handler for the get trigger by name operation
	TriggersGetTriggerByNameHandler triggers.GetTriggerByNameHandler
	// ActionsInvokeActionHandler sets the operation handler for the invoke action operation
	ActionsInvokeActionHandler actions.InvokeActionHandler
	// ActionsInvokeActionInPackageHandler sets the operation handler for the invoke action in package operation
	ActionsInvokeActionInPackageHandler actions.InvokeActionInPackageHandler
	// RulesSetStateHandler sets the operation handler for the set state operation
	RulesSetStateHandler rules.SetStateHandler
	// ActionsUpdateActionHandler sets the operation handler for the update action operation
	ActionsUpdateActionHandler actions.UpdateActionHandler
	// ActionsUpdateActionInPackageHandler sets the operation handler for the update action in package operation
	ActionsUpdateActionInPackageHandler actions.UpdateActionInPackageHandler
	// PackagesUpdatePackageHandler sets the operation handler for the update package operation
	PackagesUpdatePackageHandler packages.UpdatePackageHandler
	// RulesUpdateRuleHandler sets the operation handler for the update rule operation
	RulesUpdateRuleHandler rules.UpdateRuleHandler
	// TriggersUpdateTriggerHandler sets the operation handler for the update trigger operation
	TriggersUpdateTriggerHandler triggers.UpdateTriggerHandler

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

KwskAPI API for OpenWhisk

func NewKwskAPI

func NewKwskAPI(spec *loads.Document) *KwskAPI

NewKwskAPI creates a new Kwsk instance

func (*KwskAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*KwskAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*KwskAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*KwskAPI) Context

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

Context returns the middleware context for the kwsk API

func (*KwskAPI) DefaultConsumes

func (o *KwskAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*KwskAPI) DefaultProduces

func (o *KwskAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*KwskAPI) Formats

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

Formats returns the registered string formats

func (*KwskAPI) HandlerFor

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

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

func (*KwskAPI) Init

func (o *KwskAPI) Init()

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

func (*KwskAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*KwskAPI) RegisterConsumer

func (o *KwskAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*KwskAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*KwskAPI) RegisterProducer

func (o *KwskAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*KwskAPI) Serve

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

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

ServeErrorFor gets a error handler for a given operation id

func (*KwskAPI) SetDefaultConsumes

func (o *KwskAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*KwskAPI) SetDefaultProduces

func (o *KwskAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*KwskAPI) SetSpec

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

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

func (*KwskAPI) Validate

func (o *KwskAPI) Validate() error

Validate validates the registrations in the KwskAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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