api

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 27 Imported by: 3

Documentation

Overview

Package api contains logic for building the Service Manager API business logic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, e env.Environment, options *Options) (*web.API, error)

New returns the minimum set of REST APIs needed for the Service Manager

Types

type BaseController added in v0.2.0

type BaseController struct {
	DefaultPageSize int
	MaxPageSize     int
	// contains filtered or unexported fields
}

BaseController provides common CRUD handlers for all object types in the service manager

func NewAsyncController added in v0.9.8

func NewAsyncController(ctx context.Context, options *Options, resourceBaseURL string, objectType types.ObjectType, isAsyncDefault bool, objectBlueprint func() types.Object) *BaseController

NewAsyncController returns a new base controller with a scheduler making it effectively an async controller

func NewController added in v0.2.0

func NewController(ctx context.Context, options *Options, resourceBaseURL string, objectType types.ObjectType, objectBlueprint func() types.Object) *BaseController

NewController returns a new base controller

func (*BaseController) CreateObject added in v0.2.0

func (c *BaseController) CreateObject(r *web.Request) (*web.Response, error)

CreateObject handles the creation of a new object

func (*BaseController) DeleteObjects added in v0.2.0

func (c *BaseController) DeleteObjects(r *web.Request) (*web.Response, error)

DeleteObjects handles the deletion of the objects specified in the request

func (*BaseController) DeleteSingleObject added in v0.2.0

func (c *BaseController) DeleteSingleObject(r *web.Request) (*web.Response, error)

DeleteSingleObject handles the deletion of the object with the id specified in the request

func (*BaseController) GetOperation added in v0.9.7

func (c *BaseController) GetOperation(r *web.Request) (*web.Response, error)

GetOperation handles the fetching of a single operation with the id specified for the specified resource

func (*BaseController) GetSingleObject added in v0.2.0

func (c *BaseController) GetSingleObject(r *web.Request) (*web.Response, error)

GetSingleObject handles the fetching of a single object with the id specified in the request

func (*BaseController) ListObjects added in v0.2.0

func (c *BaseController) ListObjects(r *web.Request) (*web.Response, error)

ListObjects handles the fetching of all objects

func (*BaseController) PatchObject added in v0.2.0

func (c *BaseController) PatchObject(r *web.Request) (*web.Response, error)

PatchObject handles the update of the object with the id specified in the request

func (*BaseController) Routes added in v0.2.0

func (c *BaseController) Routes() []web.Route

Routes returns the common set of routes for all objects

type HTTPHandler

type HTTPHandler struct {
	Handler web.Handler
	// contains filtered or unexported fields
}

HTTPHandler converts a pkg/web.Handler and pkg/web.HandlerFunc to a standard http.Handler

func NewHTTPHandler

func NewHTTPHandler(handler web.Handler, requestBodyMaxSize int) *HTTPHandler

NewHTTPHandler creates a new HTTPHandler from the provided web.Handler

func (*HTTPHandler) Handle

func (h *HTTPHandler) Handle(req *web.Request) (resp *web.Response, err error)

Handle implements the web.Handler interface

func (*HTTPHandler) ServeHTTP

func (h *HTTPHandler) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP implements the http.Handler interface and allows wrapping web.Handlers into http.Handlers

type OperationsController added in v0.12.0

type OperationsController struct {
	*BaseController
}

OperationsController implements api.Controller by providing operations API logic

func NewOperationsController added in v0.12.0

func NewOperationsController(ctx context.Context, options *Options) *OperationsController

NewOperationsController returns a new controller for operations api

func (*OperationsController) Routes added in v0.12.0

func (c *OperationsController) Routes() []web.Route

type Options added in v0.3.0

type Options struct {
	Repository        storage.TransactionalRepository
	APISettings       *Settings
	OperationSettings *operations.Settings
	WSSettings        *ws.Settings
	Notificator       storage.Notificator
	WaitGroup         *sync.WaitGroup
}

type ServiceBindingController added in v0.10.0

type ServiceBindingController struct {
	*BaseController
}

ServiceBindingController implements api.Controller by providing service bindings API logic

func NewServiceBindingController added in v0.10.0

func NewServiceBindingController(ctx context.Context, options *Options) *ServiceBindingController

func (*ServiceBindingController) Routes added in v0.10.0

func (c *ServiceBindingController) Routes() []web.Route

type ServiceInstanceController added in v0.9.0

type ServiceInstanceController struct {
	*BaseController
}

ServiceInstanceController implements api.Controller by providing service Instances API logic

func NewServiceInstanceController added in v0.9.0

func NewServiceInstanceController(ctx context.Context, options *Options) *ServiceInstanceController

func (*ServiceInstanceController) Routes added in v0.9.0

func (c *ServiceInstanceController) Routes() []web.Route

type ServiceOfferingController added in v0.2.0

type ServiceOfferingController struct {
	*BaseController
}

ServiceOfferingController implements api.Controller by providing service offerings API logic

func NewServiceOfferingController added in v0.2.0

func NewServiceOfferingController(ctx context.Context, options *Options) *ServiceOfferingController

func (*ServiceOfferingController) Routes added in v0.2.0

func (c *ServiceOfferingController) Routes() []web.Route

type ServicePlanController added in v0.2.0

type ServicePlanController struct {
	*BaseController
}

ServicePlanController implements api.Controller by providing service plans API logic

func NewServicePlanController added in v0.2.0

func NewServicePlanController(ctx context.Context, options *Options) *ServicePlanController

func (*ServicePlanController) Routes added in v0.2.0

func (c *ServicePlanController) Routes() []web.Route

type Settings

type Settings struct {
	TokenIssuerURL         string   `mapstructure:"token_issuer_url" description:"url of the token issuer which to use for validating tokens"`
	ClientID               string   `mapstructure:"client_id" description:"id of the client from which the token must be issued"`
	TokenBasicAuth         bool     `` /* 178-byte string literal not displayed */
	ProtectedLabels        []string `mapstructure:"protected_labels" description:"defines labels which cannot be modified/added by REST API requests"`
	OSBVersion             string   `mapstructure:"-"`
	MaxPageSize            int      `mapstructure:"max_page_size" description:"maximum number of items that could be returned in a single page"`
	DefaultPageSize        int      `mapstructure:"default_page_size" description:"default number of items returned in a single page if not specified in request"`
	EnableInstanceTransfer bool     `mapstructure:"enable_instance_transfer" description:"whether service instance transfer is enabled or not"`
}

Settings type to be loaded from the environment

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings returns default values for API settings

func (*Settings) Validate

func (s *Settings) Validate() error

Validate validates the API settings

Directories

Path Synopsis
extensions
Package healthcheck contains logic for the Service Manager healthcheck API
Package healthcheck contains logic for the Service Manager healthcheck API
Package info contains logic for the Service Manager info API
Package info contains logic for the Service Manager info API
Package osb contains logic for building the Service Manager OSB API
Package osb contains logic for building the Service Manager OSB API

Jump to

Keyboard shortcuts

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