minibroker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstanceLabel       = "minibroker.instance"
	ServiceKey          = "service-id"
	PlanKey             = "plan-id"
	ProvisionParamsKey  = "provision-params"
	ReleaseNamespaceKey = "release-namespace"
	HeritageLabel       = "heritage"
	ReleaseLabel        = "release"
)
View Source
const (
	OperationNameKey        = "last-operation-name"
	OperationStateKey       = "last-operation-state"
	OperationDescriptionKey = "last-operation-description"
)

ConfigMap keys for tracking the last operation

View Source
const (
	ConcurrencyErrorMessage     = "ConcurrencyError"
	ConcurrencyErrorDescription = "Concurrent modification not supported"
)

Error code constants missing from go-open-service-broker-client See https://github.com/pmorie/go-open-service-broker-client/pull/136

View Source
const (
	OperationPrefixProvision   = "provision-"
	OperationPrefixDeprovision = "deprovision-"
	OperationPrefixBind        = "bind-"
)

Last operation name prefixes for various operations

View Source
const (
	BindingKeyPrefix      = "binding-"
	BindingStateKeyPrefix = "binding-state-"
)

Variables

View Source
var (
	// ErrDigNotFound is the error for a key not found in the Object.
	ErrDigNotFound = fmt.Errorf("key not found")
	// ErrDigNotString is the error for a key that is not a string.
	ErrDigNotString = fmt.Errorf("key is not a string")
)

Functions

This section is empty.

Types

type BindParams added in v1.0.0

type BindParams struct {
	Object
}

BindParams is a specialization of Object for binding parameters, ensuring type checking.

func NewBindParams added in v1.0.0

func NewBindParams(m map[string]interface{}) *BindParams

NewBindParams constructs a new BindParams.

type Client

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

func NewClient

func NewClient(
	namespace string,
	serviceCatalogEnabledOnly bool,
	clusterDomain string,
) *Client

func (*Client) Bind

func (c *Client) Bind(instanceID, serviceID, bindingID string, acceptsIncomplete bool, bindParams *BindParams) (string, error)

Bind the given service instance (of the given service) asynchronously; the binding operation key is returned.

func (*Client) Deprovision

func (c *Client) Deprovision(instanceID string, acceptsIncomplete bool) (string, error)

func (*Client) GetBinding added in v1.0.0

func (c *Client) GetBinding(instanceID, bindingID string) (*osb.GetBindingResponse, error)

func (*Client) Init

func (c *Client) Init(repoURL string) error

func (*Client) LastBindingOperationState added in v1.0.0

func (c *Client) LastBindingOperationState(instanceID, bindingID string) (*osb.LastOperationResponse, error)

func (*Client) LastOperationState added in v1.0.0

func (c *Client) LastOperationState(instanceID string, operationKey *osb.OperationKey) (*osb.LastOperationResponse, error)

LastOperationState returns the status of the last asynchronous operation. TODO(f0rmiga): This deserves some polimorphism.

func (*Client) ListServices

func (c *Client) ListServices() ([]osb.Service, error)

func (*Client) Provision

func (c *Client) Provision(instanceID, serviceID, planID, namespace string, acceptsIncomplete bool, provisionParams *ProvisionParams) (string, error)

Provision a new service instance. Returns the async operation key (if acceptsIncomplete is set).

func (*Client) Unbind added in v1.0.0

func (c *Client) Unbind(instanceID, bindingID string) error

Unbind a previously-bound instance binding.

type MariadbProvider

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

func (MariadbProvider) Bind

func (p MariadbProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	provisionParams *ProvisionParams,
	chartSecrets Object,
) (Object, error)

type MongodbProvider

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

func (MongodbProvider) Bind

func (p MongodbProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	provisionParams *ProvisionParams,
	chartSecrets Object,
) (Object, error)

type MySQLProvider

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

func (MySQLProvider) Bind

func (p MySQLProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	provisionParams *ProvisionParams,
	chartSecrets Object,
) (Object, error)

type Object added in v1.0.0

type Object map[string]interface{}

Object is a wrapper around map[string]interface{} that implements methods for helping with digging and type asserting.

func (Object) Dig added in v1.0.0

func (o Object) Dig(key string) (interface{}, bool)

Dig digs the Object based on the provided key. key must be in the format "foo.bar.baz". Each segment represents a level in the Object.

func (Object) DigString added in v1.0.0

func (o Object) DigString(key string) (string, error)

DigString wraps Object.Dig and type-asserts the found key.

func (Object) DigStringAlt added in v1.0.0

func (o Object) DigStringAlt(altKeys []string) (string, error)

DigStringAlt digs for any of the given keys, returning the first found. It returns an error if none of the alternative keys are found.

func (Object) DigStringAltOr added in v1.0.0

func (o Object) DigStringAltOr(altKeys []string, defaultValue string) (string, error)

DigStringAltOr wraps Object.DigStringAlt and returns defaultValue if none of the alternative keys are found.

func (Object) DigStringOr added in v1.0.0

func (o Object) DigStringOr(key string, defaultValue string) (string, error)

DigStringOr wraps Object.DigString and returns defaultValue if the value was not found.

type PostgresProvider

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

func (PostgresProvider) Bind

func (p PostgresProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	provisionParams *ProvisionParams,
	chartSecrets Object,
) (Object, error)

type Provider

type Provider interface {
	Bind(
		service []corev1.Service,
		bindParams *BindParams,
		provisionParams *ProvisionParams,
		chartSecrets Object,
	) (Object, error)
}

Provider is the interface for the Service Provider. Its methods wrap service-specific logic.

type ProvisionParams added in v1.0.0

type ProvisionParams struct {
	Object
}

ProvisionParams is a specialization of Object for provisioning parameters, ensuring type checking.

func NewProvisionParams added in v1.0.0

func NewProvisionParams(m map[string]interface{}) *ProvisionParams

NewProvisionParams constructs a new ProvisionParams.

type RabbitmqProvider added in v1.0.0

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

func (RabbitmqProvider) Bind added in v1.0.0

func (p RabbitmqProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	provisionParams *ProvisionParams,
	chartSecrets Object,
) (Object, error)

type RedisProvider added in v0.1.1

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

func (RedisProvider) Bind added in v0.1.1

func (p RedisProvider) Bind(
	services []corev1.Service,
	_ *BindParams,
	_ *ProvisionParams,
	chartSecrets Object,
) (Object, error)

Jump to

Keyboard shortcuts

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