broker

package
v4.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package broker holds the provisioning implementation of the service broker, providing an interface for service provisioning and binding but leaving API implementation to a containing layer

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBindingsRemain = errors.New("one or more bindings still exist, unbind before deleting")
)
View Source
var MockStatic struct {
	ExternalIP string
	ClusterIP  string
	Password   string
}

Encapsulate test global data

Functions

func CompactUUIDString

func CompactUUIDString(uuid string) (string, error)

CompactUUIDString reduces the string representation of a UUID into a shortened base32 representation of the same bits Example Input: "a7cb6bd8-cf67-400f-805c-019e85eac3bf" Example Output: "U7FWXWGPM5AA7AC4AGPIL2WDX4"

Types

type BasicCred

type BasicCred struct {
	Username string
	Password string
}

BasicCred represents a common pair of username and password

type Binder

type Binder interface {
	CreateBinding(instanceID, bindID, appID string) (BasicCred, error)
	DeleteBinding(instanceID, bindID string) error
}

Binder defines an interface for creating and deleting user bindings

type ClusterDetails

type ClusterDetails struct {
	Name        string
	ClusterIP   string
	ExternalIP  string
	ClusterName string
}

ClusterDetails encapsulates information returned about the cluster

type CreateRequest

type CreateRequest struct {
	InstanceID string
	Name       string
	Namespace  string
	PlanID     string
}

type ErrNoInstance

type ErrNoInstance struct {
	ID string
}

func (ErrNoInstance) Error

func (ni ErrNoInstance) Error() string

type Executor

type Executor interface {
	Provisioner
	Binder
	ClusterDetail(instanceID string) (ClusterDetails, error)
}

Executor defines an interface for servicing OSB requests

type Mock

type Mock struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *Mock

func (*Mock) ClusterDetail

func (m *Mock) ClusterDetail(instanceID string) (ClusterDetails, error)

func (*Mock) CreateBinding

func (m *Mock) CreateBinding(instanceID, bindID, appID string) (BasicCred, error)

func (*Mock) CreateCluster

func (m *Mock) CreateCluster(req CreateRequest) error

func (*Mock) DeleteBinding

func (m *Mock) DeleteBinding(instanceID, bindID string) error

func (*Mock) DeleteCluster

func (m *Mock) DeleteCluster(instanceID string) error

type PGOperator

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

func NewPGOperator

func NewPGOperator(KubeClient *rest.RESTClient, APIServerURL, basicAuthUsername, basicAuthPassword, clientVersion string) (*PGOperator, error)

NewPGOperator sets up authentication information for a PGO client

func (*PGOperator) ClusterDetail

func (po *PGOperator) ClusterDetail(instanceID string) (ClusterDetails, error)

ClusterDetail returns the content provided by the operator's Show Cluster

func (*PGOperator) CreateBinding

func (po *PGOperator) CreateBinding(instanceID, bindID, appID string) (BasicCred, error)

CreateBinding creates and/or returns binding information for a cluster

func (*PGOperator) CreateCluster

func (po *PGOperator) CreateCluster(req CreateRequest) error

CreateCluster implements the PGOperator interface for creating clusters

func (*PGOperator) DeleteBinding

func (po *PGOperator) DeleteBinding(instanceID, bindID string) error

DeleteBinding deletes existing binding users based on instance and bindID

func (*PGOperator) DeleteCluster

func (po *PGOperator) DeleteCluster(instanceID string) error

DeleteCluster implements the PGOperator interface for deleting clusters It also ensures all bindings are deleted prior to attempting to delete the cluster so that a clear error can be returned

type Provisioner

type Provisioner interface {
	CreateCluster(req CreateRequest) error
	DeleteCluster(instanceID string) error
}

Provisioner defines an interface for (de)provisioning clusters

Jump to

Keyboard shortcuts

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