api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 23 Imported by: 3

Documentation

Overview

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

Index

Constants

View Source
const PathParamID = "id"

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, 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 {
	// contains filtered or unexported fields
}

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

func NewController added in v0.2.0

func NewController(repository storage.Repository, 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) 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 Options added in v0.3.0

type Options struct {
	Repository  storage.Repository
	APISettings *Settings
	WSSettings  *ws.Settings
	Encrypter   security.Encrypter
	Notificator storage.Notificator
}

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(repository storage.Repository) *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(repository storage.Repository) *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"`
	SkipSSLValidation bool   `mapstructure:"skip_ssl_validation" description:"whether to skip ssl verification when making calls to external services"`
	TokenBasicAuth    bool   `` /* 178-byte string literal not displayed */
}

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