broker

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionProvisioning   action = "provisioning"
	ActionDeprovisioning action = "deprovisioning"
	ActionUpdating       action = "updating"
	ActionFailover       action = "failover"
	FailoverTimeout             = 45 * time.Minute
)

Possible actions in the operation data

View Source
const (
	DefaultHost = "0.0.0.0"
)
View Source
const ParamMaxMemoryPolicy = "maxmemory_policy"
View Source
const ParamPreferredMaintenanceWindow = "preferred_maintenance_window"
View Source
const ParamRestoreLatestSnapshotOf = "restore_from_latest_snapshot_of"
View Source
const TestFailover = "test_failover"

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, asyncAllowed bool) (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) GetBinding added in v0.20.0

func (b *Broker) GetBinding(ctx context.Context, first, second string) (brokerapi.GetBindingSpec, error)

func (*Broker) GetInstance added in v0.20.0

func (b *Broker) GetInstance(ctx context.Context, instanceID string) (brokerapi.GetInstanceDetailsSpec, error)

func (*Broker) LastBindingOperation added in v0.20.0

func (b *Broker) LastBindingOperation(ctx context.Context, first, second string, pollDetails brokerapi.PollDetails) (brokerapi.LastOperation, error)

func (*Broker) LastOperation

func (b *Broker) LastOperation(ctx context.Context, instanceID string, pollDetails brokerapi.PollDetails) (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, error)

Services returns with the provided services

func (*Broker) Unbind

func (b *Broker) Unbind(ctx context.Context, instanceID, bindingID string, details brokerapi.UnbindDetails, asyncAllowed bool) (brokerapi.UnbindSpec, 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. It can be used to update the maintenance window and / or the maxmemory policy. As this is a synchronous operation, if updating the maintenance window fails the whole operation will fail (ie. it won't try to be smart and carry on)

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"`
	Host                 string                    `json:"host"`
	TLS                  *TLSConfig                `json:"tls"`
}

func LoadConfig

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

func (Config) GetPlanConfig

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

func (Config) TLSEnabled added in v0.39.0

func (c Config) TLSEnabled() bool

func (Config) Validate

func (c Config) Validate() error

type Operation added in v0.4.0

type Operation struct {
	Action      action `json:"action"`
	PrimaryNode string `json:"primaryNode"`
	TimeOut     string `json:"timeOut"`
}

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"`
	MultiAZEnabled            bool              `json:"multi_az_enabled"`
	Parameters                map[string]string `json:"parameters"`
	Engine                    string            `json:"engine"`
	EngineVersion             string            `json:"engine_version"`
	CacheParameterGroupFamily string            `json:"cache_parameter_group_family"`
}

type ProvisionParameters

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

type TLSConfig added in v0.39.0

type TLSConfig struct {
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
}

func (*TLSConfig) GenerateTLSConfig added in v0.39.0

func (t *TLSConfig) GenerateTLSConfig() (*tls.Config, error)

GenerateTLSConfig produces a tls.Config structure out of TLSConfig. Aiming to be used while configuring a TLS client or server.

func (*TLSConfig) Validate added in v0.39.0

func (t *TLSConfig) Validate() error

type UpdateParameters

type UpdateParameters struct {
	MaxMemoryPolicy            *string `json:"maxmemory_policy"`
	PreferredMaintenanceWindow string  `json:"preferred_maintenance_window"`
	TestFailover               *bool   `json:"test_failover"`
}

Jump to

Keyboard shortcuts

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