base

package
v4.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerBase

type BrokerBase struct {
	AccountManager ServiceAccountManager
	HttpConfig     *jwt.Config
	ProjectId      string
	Logger         lager.Logger
}

BrokerBase is the reference bind and unbind implementation for brokers that bind and unbind with only Service Accounts.

func NewBrokerBase

func NewBrokerBase(projectId string, auth *jwt.Config, logger lager.Logger) BrokerBase

NewBrokerBase creates a new broker base and account manager it uses from the given settings.

func (*BrokerBase) Bind

func (b *BrokerBase) Bind(ctx context.Context, vc *varcontext.VarContext) (map[string]interface{}, error)

Bind creates a service account with access to the provisioned resource with the given instance.

func (*BrokerBase) BuildInstanceCredentials

func (b *BrokerBase) BuildInstanceCredentials(ctx context.Context, bindRecord models.ServiceBindingCredentials, instanceRecord models.ServiceInstanceDetails) (map[string]interface{}, error)

BuildInstanceCredentials combines the bind credentials with the connection information in the instance details to get a full set of connection details.

func (*BrokerBase) DeprovisionsAsync

func (b *BrokerBase) DeprovisionsAsync() bool

DeprovisionsAsync indicates if deprovisioning must be done asynchronously.

func (*BrokerBase) PollInstance

func (b *BrokerBase) PollInstance(ctx context.Context, instance models.ServiceInstanceDetails) (bool, error)

PollInstance does nothing but return an error because Base services are provisioned synchronously so this method should not be called.

func (*BrokerBase) ProvisionsAsync

func (b *BrokerBase) ProvisionsAsync() bool

ProvisionsAsync indicates if provisioning must be done asynchronously.

func (*BrokerBase) Unbind

Unbind deletes the created service account from the GCP Project.

func (*BrokerBase) UpdateInstanceDetails

func (b *BrokerBase) UpdateInstanceDetails(ctx context.Context, instance *models.ServiceInstanceDetails) error

UpdateInstanceDetails updates the ServiceInstanceDetails with the most recent state from GCP. This instance is a no-op method.

type ServiceAccountManager

type ServiceAccountManager interface {
	CreateCredentials(ctx context.Context, vc *varcontext.VarContext) (map[string]interface{}, error)
	DeleteCredentials(ctx context.Context, creds models.ServiceBindingCredentials) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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