Documentation
¶
Index ¶
- Constants
- Variables
- type Amount
- type BrokerError
- type Catalog
- type Cost
- type Dashboard
- type Plan
- type PlanMeta
- type Service
- type ServiceBindingRequest
- type ServiceBindingResponse
- type ServiceCreationRequest
- type ServiceCreationResponse
- type ServiceLastOperationResponse
- type ServiceMeta
- type ServiceProvider
- type ServiceProviderError
Constants ¶
const ( // ErrorServiceExists raised if instance already exists ErrorInstanceExists = 409 // ErrorInstanceNotFound raised if instance not found ErrorInstanceNotFound = 410 // ErrorServerException raised on server side error ErrorServerException = 500 )
Variables ¶
var GetServiceProviderErrorCode = map[string]int{
"ErrorInstanceExists": 409,
"ErrorInstanceNotFound": 410,
"ErrorServerException": 500,
}
GetErrorCode resolves error name to its code
var GetServiceProviderErrorCodeName = map[int]string{
409: "ErrorInstanceExists",
410: "ErrorInstanceNotFound",
500: "ErrorServerException",
}
GetErrorCodeName resolves error code to its string value
Functions ¶
This section is empty.
Types ¶
type Amount ¶
type Amount struct {
Usd float32 `json:"usd"`
}
Amount describers Cloud Foundry cost amount
type BrokerError ¶
type BrokerError struct {
Description string `json:"description"`
}
BrokerError describes Cloud Foundry broker error
type Catalog ¶
type Catalog struct {
Services []*Service `json:"services"`
}
Catalog describes Cloud Foundry catalog
type Dashboard ¶
type Dashboard struct {
ID string `json:"id"`
Secret string `json:"secret"`
URI string `json:"redirect_uri"`
}
Dashboard describes Cloud Foundry dashboard
type Plan ¶
type Plan struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Free bool `json:"free,omitempty"`
Bindable bool `json:"bindable,omitempty"`
Metadata *PlanMeta `json:"metadata,omitempty"`
}
Plan describes Cloud Foundry plan structure
type PlanMeta ¶
type PlanMeta struct {
Bullets []string `json:"bullets"`
Costs string `json:"costs"`
DisplayName string `json:"displayName"`
}
PlanMeta describers Cloud Foundry plan meta-data
type Service ¶
type Service struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Bindable bool `json:"bindable"`
InstancesRetrievable bool `json:"instances_retrievable"`
BindingsRetrievable bool `json:"bindings_retrievable"`
Tags []string `json:"tags,omitempty"`
PlanUpdatable bool `json:"plan_updateable"`
Plans []*Plan `json:"plans"`
Requires []string `json:"requires,omitempty"`
Metadata *ServiceMeta `json:"metadata,omitempty"`
Dashboard *Dashboard `json:"dashboard_client,omitempty"`
}
Service describes Cloud Foundry service
type ServiceBindingRequest ¶
type ServiceBindingRequest struct {
InstanceID string `json:"-"`
BindingID string `json:"-"`
ServiceID string `json:"service_id"`
PlanID string `json:"plan_id"`
AppGUID string `json:"app_guid"`
}
ServiceBindingRequest describes Cloud Foundry service binding request
type ServiceBindingResponse ¶
type ServiceBindingResponse struct {
Credentials map[string]string `json:"credentials"`
SyslogDrainURL string `json:"syslog_drain_url,omitempty"`
}
ServiceBindingResponse describes Cloud Foundry service binding response
type ServiceCreationRequest ¶
type ServiceCreationRequest struct {
InstanceID string `json:"-"`
ServiceID string `json:"service_id"`
PlanID string `json:"plan_id"`
OrganizationGUID string `json:"organization_guid"`
SpaceGUID string `json:"space_guid"`
Parameters map[string]string `json:parameters`
}
ServiceCreationRequest describes Cloud Foundry service provisioning request
type ServiceCreationResponse ¶
type ServiceCreationResponse struct {
DashboardURL string `json:"dashboard_url"`
}
ServiceCreationResponse describes Cloud Foundry service provisioning response
type ServiceMeta ¶
type ServiceMeta struct {
DisplayName string `json:"displayName"`
ImageURL string `json:"imageUrl"`
Description string `json:"longDescription"`
ProviderDisplayName string `json:"providerDisplayName"`
DocURL string `json:"documentationUrl"`
SupportURL string `json:"supportUrl"`
}
ServiceMeta describers Cloud Foundry service meta-data
type ServiceProvider ¶
type ServiceProvider interface {
// GetCatalog returns the catalog of services managed by this broker
GetCatalog() (*Catalog, *ServiceProviderError)
// CreateService creates a service instance for specific plan
CreateService(r *ServiceCreationRequest) (*ServiceCreationResponse, *ServiceProviderError)
// DeleteService deletes previously created service instance
DeleteService(instanceID string) *ServiceProviderError
// BindService binds to specified service instance and
// Returns credentials necessary to establish connection to that service
BindService(r *ServiceBindingRequest) (*ServiceBindingResponse, *ServiceProviderError)
// UnbindService removes previously created binding
UnbindService(instanceID, bindingID string) *ServiceProviderError
LastOperation(instanceID string) (*ServiceLastOperationResponse, *ServiceProviderError)
}
ServiceProvider defines the required provider functionality
type ServiceProviderError ¶
ServiceProviderError describes service provider error
func NewServiceProviderError ¶
func NewServiceProviderError(code int, err error) *ServiceProviderError
NewServiceProviderError factory for ServiceProviderError
func (*ServiceProviderError) String ¶
func (e *ServiceProviderError) String() string
String returns string representation of the error