Documentation ¶
Index ¶
- Constants
- type BindFunction
- type BindingDetails
- type BindingParameters
- type BindingValidationFunction
- type Credentials
- type InstanceDetails
- type Module
- type ProvisioningParameters
- type ProvisioningValidationFunction
- type ServiceManager
- func (s *ServiceManager) Bind(instance service.Instance, bindingParameters service.BindingParameters) (service.BindingDetails, error)
- func (s *ServiceManager) GetCredentials(service.Instance, service.Binding) (service.Credentials, error)
- func (s *ServiceManager) GetDeprovisioner(service.Plan) (service.Deprovisioner, error)
- func (s *ServiceManager) GetEmptyBindingDetails() service.BindingDetails
- func (s *ServiceManager) GetEmptyBindingParameters() service.BindingParameters
- func (s *ServiceManager) GetEmptyInstanceDetails() service.InstanceDetails
- func (s *ServiceManager) GetEmptyProvisioningParameters() service.ProvisioningParameters
- func (s *ServiceManager) GetEmptyUpdatingParameters() service.UpdatingParameters
- func (s *ServiceManager) GetProvisioner(service.Plan) (service.Provisioner, error)
- func (s *ServiceManager) GetUpdater(service.Plan) (service.Updater, error)
- func (s *ServiceManager) Unbind(instance service.Instance, bindingDetails service.BindingDetails) error
- func (s *ServiceManager) ValidateBindingParameters(bindingParameters service.BindingParameters) error
- func (s *ServiceManager) ValidateProvisioningParameters(provisioningParameters service.ProvisioningParameters) error
- func (s *ServiceManager) ValidateUpdatingParameters(updatingParameters service.UpdatingParameters) error
- type UnbindFunction
- type UpdatingParameters
- type UpdatingValidationFunction
Constants ¶
const ( // ServiceID is the service ID of the fake service ServiceID = "cdd1fb7a-d1e9-49e0-b195-e0bab747798a" // StandardPlanID is the plan ID for the standard (and only) variant of the // fake service StandardPlanID = "bd15e6f3-4ff5-477c-bb57-26313a368e74" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindFunction ¶
type BindFunction func( service.Instance, service.BindingParameters, ) (service.BindingDetails, error)
BindFunction describes a function used to provide pluggable binding behavior to the fake implementation of the service.Module interface
type BindingDetails ¶
type BindingDetails struct { }
BindingDetails represents details collected and modified over the course of a fake service instance's binding and unbinding processes. Note that, ordinarily, service-specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type BindingParameters ¶
type BindingParameters struct {
SomeParameter string `json:"someParameter"`
}
BindingParameters represents parameters specific to binding to a service instance using the fake service module. Note that, ordinarily, service-specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type BindingValidationFunction ¶
type BindingValidationFunction func(service.BindingParameters) error
BindingValidationFunction describes a function used to provide pluggable binding validation behavior to the fake implementation of the service.Module interface
type Credentials ¶
type Credentials struct { }
Credentials generally represent credentials AND/OR ANY OTHER DETAILS (e.g. URLs, port numbers, etc.) that will be conveyed back to the client upon successful completion of a bind. In the specific case of the fake service module, which doesn't do much of anything (other than generate a messageID and write some logs), there are no important details to convey back to the client. The messageID is included just to provide an example of HOW details such as these can be conveyed to the client. Note that, ordinarily, service module-specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type InstanceDetails ¶
type InstanceDetails struct {
ResourceGroupName string `json:"resourceGroup"`
}
InstanceDetails represents details collected and modified over the course of a fake service instance's provisioning and deprovisioning processes. Note that, ordinarily, service-specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type Module ¶
type Module struct {
ServiceManager *ServiceManager
}
Module is a fake implementation of the service.Module interface used to facilittate testing.
func New ¶
New returns a new instance of a type that fulfills the service.Module and provides an example of how such a module is implemented
func (*Module) GetCatalog ¶
GetCatalog returns a Catalog of service/plans offered by a module
func (*Module) GetStability ¶
GetStability returns this module's relative stability
type ProvisioningParameters ¶
type ProvisioningParameters struct {
SomeParameter string `json:"someParameter"`
}
ProvisioningParameters represents parameters specific to provisioning a service using the fake service module. Note that, ordinarily, service module- specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type ProvisioningValidationFunction ¶
type ProvisioningValidationFunction func(service.ProvisioningParameters) error
ProvisioningValidationFunction describes a function used to provide pluggable provisioning validation behavior to the fake implementation of the service.Module interface
type ServiceManager ¶ added in v0.10.0
type ServiceManager struct { ProvisioningValidationBehavior ProvisioningValidationFunction UpdatingValidationBehavior UpdatingValidationFunction BindingValidationBehavior BindingValidationFunction BindBehavior BindFunction UnbindBehavior UnbindFunction }
ServiceManager is a fake implementation of the service.ServiceManager interface used to facilitate testing.
func (*ServiceManager) Bind ¶ added in v0.10.0
func (s *ServiceManager) Bind( instance service.Instance, bindingParameters service.BindingParameters, ) (service.BindingDetails, error)
Bind synchronously binds to a service
func (*ServiceManager) GetCredentials ¶ added in v0.10.0
func (s *ServiceManager) GetCredentials( service.Instance, service.Binding, ) (service.Credentials, error)
GetCredentials returns service-specific credentials populated from instance and binding details
func (*ServiceManager) GetDeprovisioner ¶ added in v0.10.0
func (s *ServiceManager) GetDeprovisioner( service.Plan, ) (service.Deprovisioner, error)
GetDeprovisioner returns a deprovisioner that defines the steps a module must execute asynchronously to deprovision a service
func (*ServiceManager) GetEmptyBindingDetails ¶ added in v0.12.0
func (s *ServiceManager) GetEmptyBindingDetails() service.BindingDetails
GetEmptyBindingDetails returns an empty instance of a service-specific bindingDetails
func (*ServiceManager) GetEmptyBindingParameters ¶
func (s *ServiceManager) GetEmptyBindingParameters() service.BindingParameters
GetEmptyBindingParameters returns an empty instance of module-specific bindingParameters
func (*ServiceManager) GetEmptyInstanceDetails ¶ added in v0.12.0
func ( s *ServiceManager, ) GetEmptyInstanceDetails() service.InstanceDetails
GetEmptyInstanceDetails returns an empty instance of a service-specific instance details
func (*ServiceManager) GetEmptyProvisioningParameters ¶
func ( s *ServiceManager, ) GetEmptyProvisioningParameters() service.ProvisioningParameters
GetEmptyProvisioningParameters returns an empty instance of module-specific provisioningParameters
func (*ServiceManager) GetEmptyUpdatingParameters ¶
func ( s *ServiceManager, ) GetEmptyUpdatingParameters() service.UpdatingParameters
GetEmptyUpdatingParameters returns an empty instance of module-specific updatingParameters
func (*ServiceManager) GetProvisioner ¶ added in v0.10.0
func (s *ServiceManager) GetProvisioner( service.Plan, ) (service.Provisioner, error)
GetProvisioner returns a provisioner that defines the steps a module must execute asynchronously to provision a service
func (*ServiceManager) GetUpdater ¶ added in v0.10.0
GetUpdater returns a updater that defines the steps a module must execute asynchronously to update a service
func (*ServiceManager) Unbind ¶ added in v0.10.0
func (s *ServiceManager) Unbind( instance service.Instance, bindingDetails service.BindingDetails, ) error
Unbind synchronously unbinds from a service
func (*ServiceManager) ValidateBindingParameters ¶ added in v0.10.0
func (s *ServiceManager) ValidateBindingParameters( bindingParameters service.BindingParameters, ) error
ValidateBindingParameters validates the provided bindingParameters and returns an error if there is any problem
func (*ServiceManager) ValidateProvisioningParameters ¶ added in v0.10.0
func (s *ServiceManager) ValidateProvisioningParameters( provisioningParameters service.ProvisioningParameters, ) error
ValidateProvisioningParameters validates the provided provisioningParameters and returns an error if there is any problem
func (*ServiceManager) ValidateUpdatingParameters ¶ added in v0.10.0
func (s *ServiceManager) ValidateUpdatingParameters( updatingParameters service.UpdatingParameters, ) error
ValidateUpdatingParameters validates the provided updatingParameters and returns an error if there is any problem
type UnbindFunction ¶
type UnbindFunction func( service.Instance, service.BindingDetails, ) error
UnbindFunction describes a function used to provide pluggable unbinding behavior to the fake implementation of the service.Module interface
type UpdatingParameters ¶
type UpdatingParameters struct {
SomeParameter string `json:"someParameter"`
}
UpdatingParameters represents parameters specific to binding to a service instance using the fake service module. Note that, ordinarily, service module-specific types such as this do not need to be exported. An exception is made here because the fake service module is used to facilitate testing of the broker framework itself.
type UpdatingValidationFunction ¶
type UpdatingValidationFunction func(service.UpdatingParameters) error
UpdatingValidationFunction describes a function used to provide pluggable updating validation behavior to the fake implementation of the service.Module interface