Documentation

Index

Constants

View Source
const (
	StateProvisionInstanceInProgress = "Provision instance in progress"
	StateProvisionInstanceSucceeded  = "Provision instance succeeded"
	StateProvisionInstanceFailed     = "Provision instance failed"

	StateDeprovisionInstanceInProgress = "Deprovision instance in progress"
	StateDeprovisionInstanceSucceeded  = "Deprovision instance succeeded"
	StateDeprovisionInstanceFailed     = "Deprovision instance failed"

	StateBindingInProgress = "Binding in progress"
	StateBindingSucceeded  = "Binding succeeded"
	StateBindingFailed     = "Binding failed"

	StateUnBindingInProgress = "Unbinding in progress"
	StateUnBindingSucceeded  = "Unbinding succeeded"
	StateUnBindingFailed     = "Unbinding failed"
)
View Source
const AsyncLoopTime = 10

Variables

This section is empty.

Functions

func GetBrokerByName

func GetBrokerByName(brokerName string) brokerapi.ServiceBroker

func RegisterBroker

func RegisterBroker(brokerName string, broker brokerapi.ServiceBroker) bool

func RegisterBrokers

func RegisterBrokers(brokers map[string]brokerapi.ServiceBroker) bool

Types

type Async

type Async interface {
	Run()
	AddAsyncInstance(instanceInfo *InstanceRunInfo, persistent bool) error
	DeleteAsyncInstance(instanceID string) error
	UpdateAsyncInstance(instanceInfo *InstanceRunInfo) error
	GetAsyncInstance(instanceId string) *InstanceRunInfo
	GetAsyncBinding(instanceId, bindingID string) *BindRunInfo
	GetProvisionInstanceLastOperation(instanceInfo *InstanceRunInfo)
	GetDeprovisionInstanceLastOperation(instanceInfo *InstanceRunInfo)
	GetBindingLastOperation(instanceInfo *InstanceRunInfo, bindInfo *BindRunInfo)
	GetUnBindingLastOperation(instanceInfo *InstanceRunInfo, bindInfo *BindRunInfo)
}

type AsyncEngine

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

func NewAsyncEngine

func NewAsyncEngine() *AsyncEngine

func (*AsyncEngine) AddAsyncInstance

func (a *AsyncEngine) AddAsyncInstance(instanceInfo *InstanceRunInfo, persistent bool) error

func (*AsyncEngine) DeleteAsyncInstance

func (a *AsyncEngine) DeleteAsyncInstance(instanceID string) error

func (*AsyncEngine) GetAsyncBinding

func (a *AsyncEngine) GetAsyncBinding(instanceId, bindingID string) *BindRunInfo

func (*AsyncEngine) GetAsyncInstance

func (a *AsyncEngine) GetAsyncInstance(instanceId string) *InstanceRunInfo

func (*AsyncEngine) GetBindingLastOperation

func (a *AsyncEngine) GetBindingLastOperation(instanceInfo *InstanceRunInfo, bindInfo *BindRunInfo)

func (*AsyncEngine) GetDeprovisionInstanceLastOperation

func (a *AsyncEngine) GetDeprovisionInstanceLastOperation(instanceInfo *InstanceRunInfo)

func (*AsyncEngine) GetProvisionInstanceLastOperation

func (a *AsyncEngine) GetProvisionInstanceLastOperation(instanceInfo *InstanceRunInfo)

func (*AsyncEngine) GetUnBindingLastOperation

func (a *AsyncEngine) GetUnBindingLastOperation(instanceInfo *InstanceRunInfo, bindInfo *BindRunInfo)

func (*AsyncEngine) Run

func (a *AsyncEngine) Run()

func (*AsyncEngine) UpdateAsyncInstance

func (a *AsyncEngine) UpdateAsyncInstance(instanceInfo *InstanceRunInfo) error

type BaseController

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

BaseController implements the generic logic shared by all concrete service brokers. Like async process of create/delete service instance, bind/unbind and get last operation

func GetBaseController

func GetBaseController() *BaseController

func NewBaseController

func NewBaseController() *BaseController

func (*BaseController) CreateServiceBinding

func (c *BaseController) CreateServiceBinding(instanceId, serviceID,
	planID, bindingId string, parameterIn map[string]interface{}) (brokerapi.Credential, error)

func (*BaseController) CreateServiceInstance

func (c *BaseController) CreateServiceInstance(instanceId, serviceID, planID string,
	parameterIn map[string]interface{}) error

func (*BaseController) DeleteServiceBinding

func (c *BaseController) DeleteServiceBinding(instanceId, serviceID,
	planID, bindingId string, parameterIn map[string]string) error

func (*BaseController) DeleteServiceInstance

func (c *BaseController) DeleteServiceInstance(instanceId, serviceID,
	planID string, parameterIn map[string]string) error

func (*BaseController) GetCatalog

func (c *BaseController) GetCatalog() (*brokerapi.Catalog, error)

func (*BaseController) GetServiceBindingStatus

func (c *BaseController) GetServiceBindingStatus(instanceId, serviceID, planID, bindingId string, operation string) (string, error)

func (*BaseController) GetServiceBroker

func (c *BaseController) GetServiceBroker(serviceID string) (brokerName string, broker brokerapi.ServiceBroker)

func (*BaseController) GetServiceInstanceStatus

func (c *BaseController) GetServiceInstanceStatus(instanceId, serviceID,
	planID string, operation string) (string, error)

type BindRunInfo

type BindRunInfo struct {
	BindingId string
	Status    string
	Parameter map[string]interface{}
}

type BindingLastOperationPayload

type BindingLastOperationPayload struct {
	InstanceID string
	BindingID  string
	Request    brokerapi.BindingLastOperationRequest
	Result     chan brokerapi.WorkerResponse
}

func (BindingLastOperationPayload) Deal

type BindingPayload

type BindingPayload struct {
	InstanceID string
	BindingID  string
	Request    brokerapi.BindingRequest
	Result     chan brokerapi.WorkerResponse
}

func (BindingPayload) Deal

func (s BindingPayload) Deal() error

type CreateServiceInstancePayload

type CreateServiceInstancePayload struct {
	InstanceID string
	Request    brokerapi.CreateServiceInstanceRequest
	Result     chan brokerapi.WorkerResponse
}

func (CreateServiceInstancePayload) Deal

type DeleteServiceInstancePayload

type DeleteServiceInstancePayload struct {
	InstanceID string
	Request    brokerapi.DeleteServiceInstanceRequest
	Result     chan brokerapi.WorkerResponse
}

func (DeleteServiceInstancePayload) Deal

type InstanceLastOperationPayload

type InstanceLastOperationPayload struct {
	InstanceID string
	Request    brokerapi.LastOperationRequest
	Result     chan brokerapi.WorkerResponse
}

func (InstanceLastOperationPayload) Deal

type InstanceRunInfo

type InstanceRunInfo struct {
	InstanceId string
	ServiceID  string
	PlanID     string
	Bindings   map[string]*BindRunInfo
	Status     string
	BrokerName string
	Parameter  map[string]interface{}
}

type Storage

type Storage interface {
	Init()
	WriteObject(instanceInfo InstanceRunInfo)
	GetObject(instanceID string) (InstanceRunInfo, error)
	DeleteObject(instanceID string)

	GetAllObject() ([]*InstanceRunInfo, error)
}

type StorageProvider

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

func NewStorageProvider

func NewStorageProvider() *StorageProvider

func (*StorageProvider) DeleteObject

func (sp *StorageProvider) DeleteObject(instanceID string)

func (*StorageProvider) GetAllObject

func (sp *StorageProvider) GetAllObject() ([]*InstanceRunInfo, error)

func (*StorageProvider) GetObject

func (sp *StorageProvider) GetObject(instanceID string) (InstanceRunInfo, error)

func (*StorageProvider) Init

func (sp *StorageProvider) Init() error

func (*StorageProvider) WriteObject

func (sp *StorageProvider) WriteObject(instanceInfo InstanceRunInfo)

Persistent storage(etcd) api

type UnBindingPayload

type UnBindingPayload struct {
	InstanceID string
	BindingID  string
	PlanID     string
	ServiceID  string
	Result     chan brokerapi.WorkerResponse
}

func (UnBindingPayload) Deal

func (s UnBindingPayload) Deal() error