Documentation
¶
Index ¶
- type BrokerEntity
- type BrokerGUID
- type BrokerName
- type BrokerResource
- type BrokerResources
- type GetInfo
- type GetInfoInterface
- type GetInfoResponse
- type PlanGUID
- type PlanResources
- type ServiceBroker
- func (sb *ServiceBroker) CheckServiceInstancesExist(serviceName ServiceName) bool
- func (sb *ServiceBroker) CheckServiceNameExists(name ServiceName) (bool, error)
- func (sb *ServiceBroker) Create(name BrokerName, url, username, password string) error
- func (sb *ServiceBroker) Delete(name BrokerName) error
- func (sb *ServiceBroker) EnableServiceAccess(serviceGUID ServiceGUID) error
- func (sb *ServiceBroker) GetServiceBrokerGUIDByName(name BrokerName) (BrokerGUID, error)
- func (sb *ServiceBroker) GetServiceGUIDByName(name ServiceName) (ServiceGUID, error)
- func (sb *ServiceBroker) Update(serviceBrokerGUID BrokerGUID, name BrokerName, url, username, password string) error
- func (sb *ServiceBroker) UpdateAll(url, username, password string) error
- type ServiceGUID
- type ServiceInstance
- type ServiceInstanceName
- type ServiceInstanceResources
- type ServiceName
- type ServicePlan
- type ServicePlanInterface
- type ServiceResources
- type USBServiceBroker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerEntity ¶
type BrokerEntity struct { Name BrokerName `json:"name,omitempty"` BrokerURL string `json:"broker_url"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` }
A BrokerEntity a broker-specific entity definition
type BrokerGUID ¶
type BrokerGUID string
BrokerGUID is a specialized type for the GUID of a service broker
type BrokerName ¶
type BrokerName string
BrokerName is a specialized type for the name of the service broker
type BrokerResource ¶
type BrokerResource struct { Metadata struct { GUID BrokerGUID `json:"guid"` } `json:"metadata"` Entity BrokerEntity `json:"entity"` }
BrokerResource holds the broker metadata. Is mapped to json:metadata
type BrokerResources ¶
type BrokerResources struct {
Resources []BrokerResource `json:"resources"`
}
BrokerResources holds the resources for the broker. Is mapped to json:resources
type GetInfo ¶
type GetInfo struct {
// contains filtered or unexported fields
}
GetInfo is the definition of the GetInfo type
func (*GetInfo) GetTokenEndpoint ¶
GetTokenEndpoint obtains the endpoint from GetInfo
type GetInfoInterface ¶
GetInfoInterface is the interface for providing information about token endpoint
func NewGetInfo ¶
func NewGetInfo(ccAPI string, client httpclient.HTTPClient, logger lager.Logger) GetInfoInterface
NewGetInfo instantiates a new GetInfo
type GetInfoResponse ¶
type GetInfoResponse struct {
TokenEndpoint string `json:"token_endpoint"`
}
GetInfoResponse is the structure of token endpoint
type PlanResources ¶
type PlanResources struct { Resources []struct { Metadata struct { GUID PlanGUID `json:"guid"` } `json:"metadata"` Entity struct { Name string `json:"name"` Free bool `json:"free"` Description string `json:"description"` Public bool `json:"public"` ServiceGUID string `json:"service_guid"` } `json:"entity"` } `json:"resources"` }
PlanResources holds the resources for the plan
type ServiceBroker ¶
type ServiceBroker struct {
// contains filtered or unexported fields
}
ServiceBroker is the definition of ServiceBroker type
func (*ServiceBroker) CheckServiceInstancesExist ¶
func (sb *ServiceBroker) CheckServiceInstancesExist(serviceName ServiceName) bool
CheckServiceInstancesExist checks if a service instance with the passed name is already registered
func (*ServiceBroker) CheckServiceNameExists ¶
func (sb *ServiceBroker) CheckServiceNameExists(name ServiceName) (bool, error)
CheckServiceNameExists checks if a service with the passed name is already defined
func (*ServiceBroker) Create ¶
func (sb *ServiceBroker) Create(name BrokerName, url, username, password string) error
Create creates a service broker and returns an error if it fails
func (*ServiceBroker) Delete ¶
func (sb *ServiceBroker) Delete(name BrokerName) error
Delete deletes the service with the given name
func (*ServiceBroker) EnableServiceAccess ¶
func (sb *ServiceBroker) EnableServiceAccess(serviceGUID ServiceGUID) error
EnableServiceAccess enables service access for the service having serviceName
func (*ServiceBroker) GetServiceBrokerGUIDByName ¶
func (sb *ServiceBroker) GetServiceBrokerGUIDByName(name BrokerName) (BrokerGUID, error)
GetServiceBrokerGUIDByName obtains the broker guid corresponding to the passed name
func (*ServiceBroker) GetServiceGUIDByName ¶
func (sb *ServiceBroker) GetServiceGUIDByName(name ServiceName) (ServiceGUID, error)
GetServiceGUIDByName returns the GUID of any services with the given name
func (*ServiceBroker) Update ¶
func (sb *ServiceBroker) Update(serviceBrokerGUID BrokerGUID, name BrokerName, url, username, password string) error
Update updates a service broker
func (*ServiceBroker) UpdateAll ¶
func (sb *ServiceBroker) UpdateAll(url, username, password string) error
UpdateAll updates all service brokers with the given url and username to the given password
type ServiceGUID ¶
type ServiceGUID string
A ServiceGUID is the GUID of a service (~= sidecar deployment)
type ServiceInstance ¶
type ServiceInstance struct { Metadata struct { GUID string `json:"guid"` } `json:"metadata"` Value struct { Name ServiceInstanceName `json:"name"` ServicePlanGUID PlanGUID `json:"service_plan_guid"` } `json:"entity"` }
ServiceInstance holds the metadata and entity of service instance
type ServiceInstanceName ¶
type ServiceInstanceName string
A ServiceInstanceName is the name of a service instance
type ServiceInstanceResources ¶
type ServiceInstanceResources struct {
Resources []ServiceInstance `json:"resources"`
}
ServiceInstanceResources holds the service instance resources
type ServiceName ¶
type ServiceName string
A ServiceName is the name of a service (~= sidecar deployment)
type ServicePlan ¶
type ServicePlan struct {
// contains filtered or unexported fields
}
ServicePlan holds details for ServicePlan
func (*ServicePlan) GetServiceGUIDByLabel ¶
func (sp *ServicePlan) GetServiceGUIDByLabel(serviceLabel ServiceName, token uaaapi.BearerToken) (ServiceGUID, error)
GetServiceGUIDByLabel returns a cloud controller service GUID by its label
func (*ServicePlan) GetServicePlans ¶
func (sp *ServicePlan) GetServicePlans(serviceGUID ServiceGUID, token uaaapi.BearerToken) (*PlanResources, error)
GetServicePlans returns the service plans for a cloud controller service GUID and token
func (*ServicePlan) Update ¶
func (sp *ServicePlan) Update(serviceGUID ServiceGUID) error
Update updates a service to use this plan
type ServicePlanInterface ¶
type ServicePlanInterface interface { Update(ServiceGUID) error GetServiceGUIDByLabel(ServiceName, uaaapi.BearerToken) (ServiceGUID, error) GetServicePlans(ServiceGUID, uaaapi.BearerToken) (*PlanResources, error) }
ServicePlanInterface defines a service plan actions
func NewServicePlan ¶
func NewServicePlan(client httpclient.HTTPClient, token uaaapi.GetTokenInterface, ccAPI string, logger lager.Logger) ServicePlanInterface
NewServicePlan instantiates and returns a service plan
type ServiceResources ¶
type ServiceResources struct { Resources []struct { Metadata struct { GUID ServiceGUID `json:"guid"` } `json:"metadata"` } `json:"resources"` }
ServiceResources holds the resources for the service
type USBServiceBroker ¶
type USBServiceBroker interface { Create(name BrokerName, url, username, password string) error Delete(name BrokerName) error Update(serviceBrokerGUID BrokerGUID, name BrokerName, url, username, password string) error UpdateAll(url, username, password string) error EnableServiceAccess(ServiceGUID) error GetServiceBrokerGUIDByName(BrokerName) (BrokerGUID, error) GetServiceGUIDByName(ServiceName) (ServiceGUID, error) CheckServiceNameExists(ServiceName) (bool, error) CheckServiceInstancesExist(ServiceName) bool }
USBServiceBroker is the interface to use for creating and relating with a a Service Broker
func NewServiceBroker ¶
func NewServiceBroker(client httpclient.HTTPClient, token uaaapi.GetTokenInterface, ccAPI string, logger lager.Logger) USBServiceBroker
NewServiceBroker creates and returns ServiceBroker