api

package
v0.0.0-...-347bf9a Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SwaggerJSON embedded version of the swagger document used at generation time
	SwaggerJSON json.RawMessage
	// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
	FlatSwaggerJSON json.RawMessage
)

Functions

func ParseCatalog

func ParseCatalog(bytes []byte) (*models.Catalog, error)

Helper

Types

type API

type API struct {
	JSONConsumer runtime.Consumer
	JSONProducer runtime.Producer

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

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator

	// BasicAuthAuth registers a function that takes username and password and returns a principal
	// it performs authentication with basic auth
	BasicAuthFunc func(string, string) (interface{}, error)

	// Catalog Handlers
	CatalogGetHandler catalog.CatalogGetHandler

	// ServiceBinding Handlers
	ServiceBindingBindingHandler          service_bindings.ServiceBindingBindingHandler
	ServiceBindingGetHandler              service_bindings.ServiceBindingGetHandler
	ServiceBindingLastOperationGetHandler service_bindings.ServiceBindingLastOperationGetHandler
	ServiceBindingUnbindingHandler        service_bindings.ServiceBindingUnbindingHandler

	// ServiceInstance Handlers
	ServiceInstanceDeprovisionHandler      service_instances.ServiceInstanceDeprovisionHandler
	ServiceInstanceGetHandler              service_instances.ServiceInstanceGetHandler
	ServiceInstanceLastOperationGetHandler service_instances.ServiceInstanceLastOperationGetHandler
	ServiceInstanceProvisionHandler        service_instances.ServiceInstanceProvisionHandler
	ServiceInstanceUpdateHandler           service_instances.ServiceInstanceUpdateHandler
	// contains filtered or unexported fields
}

func New

func New(spec *loads.Document) *API

func (*API) AuthenticatorsFor

func (api *API) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Authorizer

func (api *API) Authorizer() runtime.Authorizer

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Configure

func (api *API) Configure(config *Config) *API

func (*API) ConsumersFor

func (api *API) ConsumersFor(types []string) map[string]runtime.Consumer

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Context

func (api *API) Context() *middleware.Context

func (*API) DefaultConsumes

func (api *API) DefaultConsumes() string

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) DefaultProduces

func (api *API) DefaultProduces() string

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Formats

func (api *API) Formats() strfmt.Registry

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) HandlerFor

func (api *API) HandlerFor(method, path string) (http.Handler, bool)

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Init

func (api *API) Init()

func (*API) ProducersFor

func (api *API) ProducersFor(types []string) map[string]runtime.Producer

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) Serve

func (api *API) Serve(builder middleware.Builder) http.Handler

func (*API) ServeErrorFor

func (api *API) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

Implements RoutableAPI interface -- https://pkg.go.dev/github.com/go-openapi/runtime/middleware#RoutableAPI

func (*API) WithCatalog

func (api *API) WithCatalog(catalog *models.Catalog) *API

type Config

type Config struct {
	Catalog *models.Catalog
}

Directories

Path Synopsis
operations

Jump to

Keyboard shortcuts

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