testdrive

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package testdrive is used in testing and local development to take the broker for a test drive

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Database string
	Port     int
	Client   *client.Client

	Stdout *bytes.Buffer
	Stderr *bytes.Buffer
	// contains filtered or unexported fields
}

func StartBroker

func StartBroker(csbPath, bpk, db string, opts ...StartBrokerOption) (*Broker, error)

func (*Broker) CreateBinding

func (b *Broker) CreateBinding(s ServiceInstance, opts ...CreateBindingOption) (ServiceBinding, error)

func (*Broker) DeleteBinding

func (b *Broker) DeleteBinding(s ServiceInstance, serviceBindingGUID string) error

func (*Broker) Deprovision

func (b *Broker) Deprovision(s ServiceInstance) error

func (*Broker) LastOperation

func (b *Broker) LastOperation(serviceInstanceGUID string) (domain.LastOperation, error)

func (*Broker) LastOperationFinalState

func (b *Broker) LastOperationFinalState(serviceInstanceGUID string) (domain.LastOperationState, error)

func (*Broker) LastOperationFinalValue

func (b *Broker) LastOperationFinalValue(serviceInstanceGUID string) (domain.LastOperation, error)

func (*Broker) Provision

func (b *Broker) Provision(serviceOfferingGUID, servicePlanGUID string, opts ...ProvisionOption) (ServiceInstance, error)

func (*Broker) Stop

func (b *Broker) Stop() error

func (*Broker) UpdateService

func (b *Broker) UpdateService(s ServiceInstance, opts ...UpdateOption) error

func (*Broker) UpgradeService

func (b *Broker) UpgradeService(s ServiceInstance, version string, opts ...UpgradeOption) error

type CreateBindingOption

type CreateBindingOption func(*createBindingConfig) error

func WithBindingGUID

func WithBindingGUID(guid string) CreateBindingOption

func WithBindingParams

func WithBindingParams(params any) CreateBindingOption

type ProvisionOption

type ProvisionOption func(*provisionConfig) error

func WithProvisionParams

func WithProvisionParams(params any) ProvisionOption

func WithProvisionServiceInstanceGUID

func WithProvisionServiceInstanceGUID(guid string) ProvisionOption

type ServiceBinding

type ServiceBinding struct {
	GUID string
	Body string
}

type ServiceInstance

type ServiceInstance struct {
	GUID                string
	ServicePlanGUID     string
	ServiceOfferingGUID string
}

type StartBrokerOption

type StartBrokerOption func(config *startBrokerConfig)

func WithAllowedEnvs

func WithAllowedEnvs(allowed []string) StartBrokerOption

func WithEnv

func WithEnv(extraEnv ...string) StartBrokerOption

func WithOutputs

func WithOutputs(stdout, stderr io.Writer) StartBrokerOption

type UnexpectedStatusError

type UnexpectedStatusError struct {
	StatusCode   int
	ResponseBody []byte
}

func (*UnexpectedStatusError) Error

func (u *UnexpectedStatusError) Error() string

type UpdateOption

type UpdateOption func(*updateConfig) error

func WithUpdateMaintenanceInfo

func WithUpdateMaintenanceInfo(m domain.MaintenanceInfo) UpdateOption

func WithUpdateParams

func WithUpdateParams(params any) UpdateOption

func WithUpdatePlan

func WithUpdatePlan(servicePlanGUID string) UpdateOption

func WithUpdatePreviousValues

func WithUpdatePreviousValues(v domain.PreviousValues) UpdateOption

type UpgradeOption

type UpgradeOption func(*upgradeConfig) error

func WithUpgradeParams

func WithUpgradeParams(params any) UpgradeOption

func WithUpgradePreviousValues

func WithUpgradePreviousValues(v domain.PreviousValues) UpgradeOption

Jump to

Keyboard shortcuts

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