Documentation ¶
Overview ¶
Package api contains logic for building the Service Manager API business logic
Index ¶
- Constants
- func New(ctx context.Context, repository storage.Repository, settings *Settings, ...) (*web.API, error)
- type BaseController
- func (c *BaseController) CreateObject(r *web.Request) (*web.Response, error)
- func (c *BaseController) DeleteObjects(r *web.Request) (*web.Response, error)
- func (c *BaseController) DeleteSingleObject(r *web.Request) (*web.Response, error)
- func (c *BaseController) GetSingleObject(r *web.Request) (*web.Response, error)
- func (c *BaseController) ListObjects(r *web.Request) (*web.Response, error)
- func (c *BaseController) PatchObject(r *web.Request) (*web.Response, error)
- func (c *BaseController) Routes() []web.Route
- type HTTPHandler
- type ServiceOfferingController
- type ServicePlanController
- type Settings
Constants ¶
const PathParamID = "id"
Variables ¶
This section is empty.
Functions ¶
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
CreateObject handles the creation of a new object
func (*BaseController) DeleteObjects ¶ added in v0.2.0
DeleteObjects handles the deletion of the objects specified in the request
func (*BaseController) DeleteSingleObject ¶ added in v0.2.0
DeleteSingleObject handles the deletion of the object with the id specified in the request
func (*BaseController) GetSingleObject ¶ added in v0.2.0
GetSingleObject handles the fetching of a single object with the id specified in the request
func (*BaseController) ListObjects ¶ added in v0.2.0
ListObjects handles the fetching of all objects
func (*BaseController) PatchObject ¶ added in v0.2.0
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 ¶
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) 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 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"` ClientID string `mapstructure:"client_id"` SkipSSLValidation bool `mapstructure:"skip_ssl_validation"` TokenBasicAuth bool `mapstructure:"token_basic_auth"` }
Settings type to be loaded from the environment
func DefaultSettings ¶
func DefaultSettings() *Settings
DefaultSettings returns default values for API settings
Source Files ¶
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 |