Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) BuildRedisOptions() ([]redis.DialOption, error)
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetClient() *redis.ClientConfig
- func (c *Config) GetConfigID() string
- func (x *Config) GetKvKeyOpts() *kvkey.Config
- func (x *Config) GetNoGenerateKey() bool
- func (x *Config) GetNoWriteKey() bool
- func (x *Config) GetStoreConfig() *kvtx.Config
- func (x *Config) GetVerbose() bool
- func (x *Config) GetVolumeConfig() *controller.Config
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Coordinator
- func (c *Coordinator) Capability(ctx context.Context, scope coord.Scope) (*coord.Capability, error)
- func (c *Coordinator) Snapshot(ctx context.Context, scope coord.Scope) (*coord.Snapshot, error)
- func (c *Coordinator) TryAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, bool, error)
- func (c *Coordinator) WaitAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, error)
- func (c *Coordinator) Watch(ctx context.Context, scope coord.Scope, afterGeneration uint64) (coord.Watch, error)
- type Factory
- func (t *Factory) Construct(ctx context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (t *Factory) ConstructConfig() config.Config
- func (t *Factory) GetConfigID() string
- func (t *Factory) GetControllerID() string
- func (t *Factory) GetVersion() controller.Version
- type Redis
Constants ¶
const ControllerID = "hydra/volume/redis"
ControllerID identifies the Redis volume controller.
Variables ¶
var ConfigID = ControllerID
ConfigID is the id attached to the config objects.
var Version = controller.MustParseVersion("0.0.1")
Version is the version of the redis implementation.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Client configures the redis client.
Client *redis.ClientConfig `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"`
// KvKeyOpts are key/value options.
KvKeyOpts *kvkey.Config `protobuf:"bytes,2,opt,name=kv_key_opts,json=kvKeyOpts,proto3" json:"kvKeyOpts,omitempty"`
// NoGenerateKey indicates the controller should not generate a private key if
// one is not already present. Setting this to false will cause the system to
// create a new private key if one is not present in the store at startup. If
// no key is in the store at startup and this is true, returns an error.
NoGenerateKey bool `protobuf:"varint,3,opt,name=no_generate_key,json=noGenerateKey,proto3" json:"noGenerateKey,omitempty"`
// NoWriteKey indicates the controller should not write a private key to
// storage if it generates one. This results in an ephemeral volume peer
// identity if there is no key present in the store already.
//
// Has no effect if the store has a peer private key.
NoWriteKey bool `protobuf:"varint,7,opt,name=no_write_key,json=noWriteKey,proto3" json:"noWriteKey,omitempty"`
// Verbose indicates we should log every operation.
Verbose bool `protobuf:"varint,4,opt,name=verbose,proto3" json:"verbose,omitempty"`
// VolumeConfig is the volume controller config.
VolumeConfig *controller.Config `protobuf:"bytes,5,opt,name=volume_config,json=volumeConfig,proto3" json:"volumeConfig,omitempty"`
// StoreConfig is the store configuration for kvtx.
StoreConfig *kvtx.Config `protobuf:"bytes,6,opt,name=store_config,json=storeConfig,proto3" json:"storeConfig,omitempty"`
// contains filtered or unexported fields
}
Config is the redis volume controller config. Url is the only mandatory flag.
func (*Config) BuildRedisOptions ¶
func (c *Config) BuildRedisOptions() ([]redis.DialOption, error)
BuildRedisOptions builds redis options from the config.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetClient ¶
func (x *Config) GetClient() *redis.ClientConfig
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.
func (*Config) GetKvKeyOpts ¶
func (*Config) GetNoGenerateKey ¶
func (*Config) GetNoWriteKey ¶
func (*Config) GetStoreConfig ¶
func (*Config) GetVerbose ¶
func (*Config) GetVolumeConfig ¶
func (x *Config) GetVolumeConfig() *controller.Config
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Coordinator ¶ added in v0.57.2
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator combines an inner coordinator for ObjectStore scopes with TTL-guarded redis keys for cross-process keyed exclusion.
func NewCoordinator ¶ added in v0.57.2
func NewCoordinator(pool *redis.Pool, storeID string, inner coord.Coordinator) *Coordinator
NewCoordinator builds a redis coordinator. Scopes without a Key delegate to inner. storeID identifies the volume's redis key namespace.
func (*Coordinator) Capability ¶ added in v0.57.2
func (c *Coordinator) Capability(ctx context.Context, scope coord.Scope) (*coord.Capability, error)
Capability reports keyed redis lease support, delegating ObjectStore scopes.
func (*Coordinator) Snapshot ¶ added in v0.57.2
Snapshot delegates ObjectStore scopes; keyed scopes carry no generations.
func (*Coordinator) TryAcquireWriteLease ¶ added in v0.57.2
func (c *Coordinator) TryAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, bool, error)
TryAcquireWriteLease attempts to set the keyed redis lease without blocking.
func (*Coordinator) WaitAcquireWriteLease ¶ added in v0.57.2
func (c *Coordinator) WaitAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, error)
WaitAcquireWriteLease waits until the keyed redis lease is available.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a Redis-backed volume.
func NewFactory ¶
NewFactory builds a Redis-backed volume factory.
func (*Factory) Construct ¶
func (t *Factory) Construct( ctx context.Context, conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the unique ID for the config.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
func (t *Factory) GetVersion() controller.Version
GetVersion returns the version of this controller.