broker

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionProvisioning   = "provisioning"
	ActionDeprovisioning = "deprovisioning"
	ActionUpdating       = "updating"
)

Possible actions in the operation data

View Source
const ParamMaxMemoryPolicy = "maxmemory_policy"
View Source
const ParamRestoreLatestSnapshotOf = "restore_from_latest_snapshot_of"

Variables

View Source
var (
	ErrNoSuchPlan = errors.New("no plan found")
)

Functions

Types

type BindParameters

type BindParameters struct{}

type Broker

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

Broker is the open service broker API implementation for AWS Elasticache Redis

func New

func New(config Config, provider providers.Provider, logger lager.Logger) *Broker

New creates a new broker instance

func (*Broker) Bind

func (b *Broker) Bind(ctx context.Context, instanceID, bindingID string, details brokerapi.BindDetails) (brokerapi.Binding, error)

Bind binds an application and a service instance

func (*Broker) Deprovision

func (b *Broker) Deprovision(ctx context.Context, instanceID string, details brokerapi.DeprovisionDetails, asyncAllowed bool) (brokerapi.DeprovisionServiceSpec, error)

Deprovision deletes a service instance

func (*Broker) LastOperation

func (b *Broker) LastOperation(ctx context.Context, instanceID, operationData string) (brokerapi.LastOperation, error)

LastOperation returns with the last known state of the given service instance

func (*Broker) Provision

func (b *Broker) Provision(ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, asyncAllowed bool) (brokerapi.ProvisionedServiceSpec, error)

Provision creates a new ElastiCache replication group

func (*Broker) Services

func (b *Broker) Services(ctx context.Context) []brokerapi.Service

Services returns with the provided services

func (*Broker) Unbind

func (b *Broker) Unbind(ctx context.Context, instanceID, bindingID string, details brokerapi.UnbindDetails) error

Unbind removes the binding between an application and a service instance

func (*Broker) Update

func (b *Broker) Update(ctx context.Context, instanceID string, details brokerapi.UpdateDetails, asyncAllowed bool) (brokerapi.UpdateServiceSpec, error)

Update modifies an existing service instance

type ByCreateTime added in v0.8.0

type ByCreateTime []providers.SnapshotInfo

Sort providers.SnapshotInfo

func (ByCreateTime) Len added in v0.8.0

func (ct ByCreateTime) Len() int

func (ByCreateTime) Less added in v0.8.0

func (ct ByCreateTime) Less(i, j int) bool

func (ByCreateTime) Swap added in v0.8.0

func (ct ByCreateTime) Swap(i, j int)

type Config

type Config struct {
	LogLevel             string                    `json:"log_level"`
	Username             string                    `json:"username"`
	Password             string                    `json:"password"`
	Region               string                    `json:"region"`
	BrokerName           string                    `json:"broker_name"`
	CacheSubnetGroupName string                    `json:"cache_subnet_group_name"`
	VpcSecurityGroupIds  []string                  `json:"vpc_security_group_ids"`
	Catalog              brokerapi.CatalogResponse `json:"catalog"`
	PlanConfigs          map[string]PlanConfig     `json:"plan_configs"`
	KmsKeyID             string                    `json:"kms_key_id"`
	SecretsManagerPath   string                    `json:"secrets_manager_path"`
}

func LoadConfig

func LoadConfig(configFile string) (config Config, err error)

func (Config) GetPlanConfig

func (c Config) GetPlanConfig(planID string) (PlanConfig, error)

func (Config) Validate

func (c Config) Validate() error

type Operation added in v0.4.0

type Operation struct {
	Action string `json:"action"`
}

Operation is the operation data passed back by the provision/deprovision/update calls and received by the last operation call

func (Operation) String added in v0.4.0

func (o Operation) String() string

type PlanConfig

type PlanConfig struct {
	InstanceType             string            `json:"instance_type"`
	ReplicasPerNodeGroup     int64             `json:"replicas_per_node_group"`
	ShardCount               int64             `json:"shard_count"`
	SnapshotRetentionLimit   int64             `json:"snapshot_retention_limit"`
	AutomaticFailoverEnabled bool              `json:"automatic_failover_enabled"`
	Parameters               map[string]string `json:"parameters"`
}

type ProvisionParameters

type ProvisionParameters struct {
	RestoreFromLatestSnapshotOf *string `json:"restore_from_latest_snapshot_of"`
	MaxMemoryPolicy             *string `json:"maxmemory_policy"`
}

type UpdateParameters

type UpdateParameters struct {
	MaxMemoryPolicy *string `json:"maxmemory_policy"`
}

Jump to

Keyboard shortcuts

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