fake

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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

BindFunction describes a function used to provide pluggable binding behavior to the fake implementation of the service.Module interface

type BindingValidationFunction

type BindingValidationFunction func(
	service.BindingParameters,
	service.SecureBindingParameters,
) error

BindingValidationFunction describes a function used to provide pluggable binding validation behavior to the fake implementation of the service.Module interface

type Module

type Module struct {
	ServiceManager *ServiceManager
}

Module is a fake implementation of the service.Module interface used to facilittate testing.

func New

func New() (*Module, error)

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

func (m *Module) GetCatalog() (service.Catalog, error)

GetCatalog returns a Catalog of service/plans offered by a module

func (*Module) GetName

func (m *Module) GetName() string

GetName returns this module's name

func (*Module) GetStability

func (m *Module) GetStability() service.Stability

GetStability returns this module's relative stability

type ProvisioningValidationFunction

type ProvisioningValidationFunction func(
	service.ProvisioningParameters,
	service.SecureProvisioningParameters,
) 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

Bind synchronously binds to a service

func (*ServiceManager) GetCredentials added in v0.10.0

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) 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

func (s *ServiceManager) GetUpdater(service.Plan) (service.Updater, error)

GetUpdater returns a updater that defines the steps a module must execute asynchronously to update a service

func (*ServiceManager) SplitBindingParameters added in v0.10.0

SplitBindingParameters splits a map of binding parameters into two separate maps, with one containing non-sensitive binding parameters and the other containing sensitive binding parameters.

func (*ServiceManager) SplitProvisioningParameters added in v0.10.0

SplitProvisioningParameters splits a map of provisioning parameters into two separate maps, with one containing non-sensitive provisioning parameters and the other containing sensitive provisioning parameters.

func (*ServiceManager) Unbind added in v0.10.0

func (s *ServiceManager) Unbind(
	instance service.Instance,
	binding service.Binding,
) error

Unbind synchronously unbinds from a service

func (*ServiceManager) ValidateBindingParameters added in v0.10.0

func (s *ServiceManager) ValidateBindingParameters(
	bindingParameters service.BindingParameters,
	secureBindingParameters service.SecureBindingParameters,
) 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,
	secureProvisioningParameters service.SecureProvisioningParameters,
) 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(
	instance service.Instance,
) error

ValidateUpdatingParameters validates the provided updating parameters and returns an error if there is any problem

type UnbindFunction

type UnbindFunction func(
	service.Instance,
	service.Binding,
) error

UnbindFunction describes a function used to provide pluggable unbinding behavior to the fake implementation of the service.Module interface

type UpdatingValidationFunction

type UpdatingValidationFunction func(service.Instance) error

UpdatingValidationFunction describes a function used to provide pluggable updating validation behavior to the fake implementation of the service.Module interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL