fake

package
v0.0.0-...-feb569f Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder struct {
	Reqs []*framework.BindRequest
	Res  *framework.BindResponse
}

Binder is a fake implementation of the (github.com/deis/steward-framework).Binder interface that is suitable for use in unit tests.

func (*Binder) Bind

func (b *Binder) Bind(
	ctx context.Context,
	serviceBrokerSpec framework.ServiceBrokerSpec,
	req *framework.BindRequest,
) (*framework.BindResponse, error)

Bind is the Binder interface implementation. It just records the BindRequest and returns a hardcoded BindResponse.

type Cataloger

type Cataloger struct {
	Services []*framework.Service
}

Cataloger is a fake implementation of the (github.com/deis/steward-framework).Cataloger interface that is suitable for use in unit tests.

func (Cataloger) List

func (f Cataloger) List(ctx context.Context, spec framework.ServiceBrokerSpec) ([]*framework.Service, error)

List is the Cataloger interface implementation. It returns a hardcoded, empty array of Service pointers.

type Deprovisioner

type Deprovisioner struct {
	Reqs []*framework.DeprovisionRequest
	Res  *framework.DeprovisionResponse
	Err  error
}

Deprovisioner is a fake implementation of the (github.com/deis/steward-framework).Deprovisioner interface that is suitable for use in unit tests.

func NewDeprovisioner

func NewDeprovisioner() *Deprovisioner

NewDeprovisioner returns a new fake framework.Provisioner

func (*Deprovisioner) Deprovision

func (d *Deprovisioner) Deprovision(
	ctx context.Context,
	serviceBrokerSpec framework.ServiceBrokerSpec,
	req *framework.DeprovisionRequest,
) (*framework.DeprovisionResponse, error)

Deprovision is the Deprovisioner interface implementation. It just records the DeprovisionRequest and returns a hardcoded DeprovisionResponse.

type Lifecycler

type Lifecycler struct {
	framework.Provisioner
	framework.Deprovisioner
	framework.Binder
	framework.Unbinder
	framework.OperationStatusRetriever
}

Lifecycler is a composition of this package's fake implementations of the Provisioner, Deprovisioner, Binder, Unbinder, and OperationStatusRetriever interfaces. It is suitable for use in unit tests.

type OperationStatusRetriever

type OperationStatusRetriever struct {
	Reqs []*framework.OperationStatusRequest
	Res  func() *framework.OperationStatusResponse
}

OperationStatusRetriever is a fake implementation of the (github.com/deis/steward-framework).OperationStatusRetriever interface that is suitable for use in unit tests.

func (*OperationStatusRetriever) GetOperationStatus

func (o *OperationStatusRetriever) GetOperationStatus(
	ctx context.Context,
	brokerSpec framework.ServiceBrokerSpec,
	req *framework.OperationStatusRequest,
) (*framework.OperationStatusResponse, error)

GetOperationStatus is the OperationStatusRetriever implementation. It just records the OperationStatusRequest and returns a hardcoded OperationStatusResponse.

type Provisioner

type Provisioner struct {
	Reqs []*framework.ProvisionRequest
	Res  *framework.ProvisionResponse
	Err  error
}

Provisioner is a fake implementation of the (github.com/deis/steward-framework).Provisioner interface that is suitable for use in unit tests.

func NewProvisioner

func NewProvisioner() *Provisioner

NewProvisioner returns a new fake framework.Provisioner

func (*Provisioner) Provision

func (p *Provisioner) Provision(
	ctx context.Context,
	serviceBrokerSpec framework.ServiceBrokerSpec,
	req *framework.ProvisionRequest,
) (*framework.ProvisionResponse, error)

Provision is the Provisioner interface implementation. It just records the ProvisionRequest and returns a hardcoded ProvisionResponse.

type Unbinder

type Unbinder struct {
	Reqs []*framework.UnbindRequest
}

Unbinder is a fake implementation of the (github.com/deis/steward-framework).Unbinder interface that is suitable for use in unit tests.

func (*Unbinder) Unbind

func (u *Unbinder) Unbind(
	ctx context.Context,
	serviceBrokerSpec framework.ServiceBrokerSpec,
	req *framework.UnbindRequest,
) error

Unbind is the Unbinder interface implementation. It just records the UnbindRequest and returns nil.

Jump to

Keyboard shortcuts

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