api

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 36 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 GetResourceOperation added in v0.14.0

func GetResourceOperation(r *web.Request, repository storage.Repository, objectType types.ObjectType) (*web.Response, error)

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 AgentsController added in v0.18.3

type AgentsController struct {
	// contains filtered or unexported fields
}

func NewAgentsController added in v0.18.3

func NewAgentsController(agentsConfig *agents.Settings) *AgentsController

func (*AgentsController) GetSupportedVersions added in v0.18.3

func (c *AgentsController) GetSupportedVersions(req *web.Request) (resp *web.Response, err error)

func (*AgentsController) Routes added in v0.18.3

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

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, supportsCascadeDelete bool) *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, supportsCascadeDelete bool) *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 {
	RedisClient       *redis.Client
	Repository        storage.TransactionalRepository
	APISettings       *Settings
	OperationSettings *operations.Settings
	WSSettings        *ws.Settings
	Notificator       storage.Notificator
	WaitGroup         *sync.WaitGroup
	TenantLabelKey    string
	Agents            *agents.Settings
}

type RateLimiterConfiguration added in v0.17.2

type RateLimiterConfiguration struct {
	// contains filtered or unexported fields
}

type ServiceBindingController added in v0.10.0

type ServiceBindingController struct {
	*BaseController
	// contains filtered or unexported fields
}

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) GetParameters added in v0.16.7

func (c *ServiceBindingController) GetParameters(r *web.Request) (*web.Response, error)

func (*ServiceBindingController) PatchObjectNameAndLabels added in v0.22.5

func (c *ServiceBindingController) PatchObjectNameAndLabels(r *web.Request) (*web.Response, error)

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
	// contains filtered or unexported fields
}

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) GetParameters added in v0.16.7

func (c *ServiceInstanceController) GetParameters(r *web.Request) (*web.Response, error)

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 {
	ServiceManagerTenantId     string   `mapstructure:"service_manager_tenant_id" description:"tenant id of the service manager"`
	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"`
	RateLimit                  string   `mapstructure:"rate_limit" description:"rate limiter configuration defined in format: rate<:path><,rate<:path>,...>"`
	RateLimitingEnabled        bool     `mapstructure:"rate_limiting_enabled" description:"enable rate limiting"`
	RateLimitExcludeClients    []string `` /* 132-byte string literal not displayed */
	RateLimitExcludePaths      []string `mapstructure:"rate_limit_exclude_paths" description:"define paths that should be excluded from the rate limiter processing"`
	RateLimitUsageLogThreshold int64    `` /* 187-byte string literal not displayed */
	DisabledQueryParameters    []string `` /* 139-byte string literal not displayed */
	OSBRSAPublicKey            string   `mapstructure:"osb_rsa_public_key"`
	OSBRSAPrivateKey           string   `mapstructure:"osb_rsa_private_key"`
	OSBSuccessorRSAPublicKey   string   `mapstructure:"osb_successor_rsa_public_key"`
}

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

type TenantController added in v0.14.0

type TenantController struct {
	// contains filtered or unexported fields
}

func NewTenantController added in v0.14.0

func NewTenantController(repository storage.Repository) *TenantController

func (*TenantController) GetOperation added in v0.14.0

func (c *TenantController) GetOperation(req *web.Request) (resp *web.Response, err error)

func (*TenantController) Routes added in v0.14.0

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

Directories

Path Synopsis
common
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