Documentation ¶
Index ¶
- Variables
- func Set(cs ConfigStore)
- type ConfigStore
- type ConfigStoreWatcher
- type EtcdConfigStore
- func (s *EtcdConfigStore) DeleteBlock(ctx context.Context, id string) error
- func (s *EtcdConfigStore) DeleteServer(ctx context.Context, id string) error
- func (s *EtcdConfigStore) GetBlock(ctx context.Context, id string) (oproto.Block, error)
- func (s *EtcdConfigStore) GetRetentionPolicy(ctx context.Context) (oproto.RetentionPolicy, error)
- func (s *EtcdConfigStore) GetServer(ctx context.Context, id string) (oproto.ClusterMember, error)
- func (s *EtcdConfigStore) Start(ctx context.Context) error
- func (s *EtcdConfigStore) Stop() error
- func (s *EtcdConfigStore) SubscribeChanges() (ConfigStoreWatcher, error)
- func (s *EtcdConfigStore) UnsubscribeChanges(ConfigStoreWatcher) error
- func (s *EtcdConfigStore) UpdateBlock(ctx context.Context, block oproto.Block) error
- func (s *EtcdConfigStore) UpdateRetentionPolicy(ctx context.Context, policy oproto.RetentionPolicy) error
- func (s *EtcdConfigStore) UpdateServer(ctx context.Context, member oproto.ClusterMember) error
- type LocalConfigStore
- func (s *LocalConfigStore) DeleteBlock(ctx context.Context, id string) error
- func (s *LocalConfigStore) DeleteServer(ctx context.Context, id string) error
- func (s *LocalConfigStore) GetBlock(ctx context.Context, id string) (oproto.Block, error)
- func (s *LocalConfigStore) GetClusterConfig(ctx context.Context) *oproto.ClusterConfig
- func (s *LocalConfigStore) GetRetentionPolicy(ctx context.Context) (oproto.RetentionPolicy, error)
- func (s *LocalConfigStore) GetServer(ctx context.Context, id string) (oproto.ClusterMember, error)
- func (s *LocalConfigStore) GetTaskName() string
- func (s *LocalConfigStore) GetThisServer(ctx context.Context) oproto.ClusterMember
- func (s *LocalConfigStore) SetTaskName(name string)
- func (s *LocalConfigStore) Start(ctx context.Context) error
- func (s *LocalConfigStore) Stop() error
- func (s *LocalConfigStore) SubscribeChanges() (ConfigStoreWatcher, error)
- func (s *LocalConfigStore) UnsubscribeChanges(watcher ConfigStoreWatcher) error
- func (s *LocalConfigStore) UpdateBlock(ctx context.Context, block oproto.Block) error
- func (s *LocalConfigStore) UpdateRetentionPolicy(ctx context.Context, policy oproto.RetentionPolicy) error
- func (s *LocalConfigStore) UpdateServer(ctx context.Context, member oproto.ClusterMember) error
- func (s *LocalConfigStore) UpdateThisState(ctx context.Context, state oproto.ClusterMember_State) error
- type LocalConfigStoreWatcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Current cluster configuration Config *oproto.ClusterConfig )
Functions ¶
func Set ¶
func Set(cs ConfigStore)
Types ¶
type ConfigStore ¶
type ConfigStore interface { // Start begins the config store process. It may not perform any actual work. Start(ctx context.Context) error // Stop ends the config store process. It will block until the store has been cleanly closed. Stop() error SetTaskName(name string) GetTaskName() string GetClusterConfig(ctx context.Context) *oproto.ClusterConfig // GetServer gets the ClusterMember configuration for the current server. GetThisServer(ctx context.Context) oproto.ClusterMember // GetServer gets the ClusterMember configuration for a single server. GetServer(ctx context.Context, id string) (oproto.ClusterMember, error) // GetRetentionPolicy gets the entire retention policy GetRetentionPolicy(ctx context.Context) (oproto.RetentionPolicy, error) // GetBlock gets the current state of a single block by ID GetBlock(ctx context.Context, id string) (oproto.Block, error) // UpdateServer updates the configuration for a server // This blocks until the configuration has been flushed to the config store. UpdateServer(ctx context.Context, member oproto.ClusterMember) error // UpdateThisState updates the running state for this server. UpdateThisState(ctx context.Context, state oproto.ClusterMember_State) error // UpdateRetentionPolicy sets the retention policy // This blocks until the configuration has been flushed to the config store. UpdateRetentionPolicy(ctx context.Context, policy oproto.RetentionPolicy) error // UpdateBlock sets the configuration for a block. // This blocks until the configuration has been flushed to the config store. UpdateBlock(ctx context.Context, block oproto.Block) error // DeleteServer removes a server from configuration. DeleteServer(ctx context.Context, name string) error // DeleteBlock removes a block from configuration. DeleteBlock(ctx context.Context, id string) error // SubscribeChanges creates a new watcher on the config store. // The returned object contains a channel that can be waited on for updates SubscribeChanges() (ConfigStoreWatcher, error) // UnsubscribeChanges stops an existing watcher. UnsubscribeChanges(watcher ConfigStoreWatcher) error }
func Get ¶
func Get() ConfigStore
type ConfigStoreWatcher ¶
type ConfigStoreWatcher interface {
Chan() <-chan oproto.ClusterConfig
}
type EtcdConfigStore ¶
type EtcdConfigStore struct { // Current cluster configuration Config *oproto.ClusterConfig Cancel context.CancelFunc // contains filtered or unexported fields }
func NewEtcdConfigStore ¶
func NewEtcdConfigStore(ctx context.Context) (*EtcdConfigStore, error)
func (*EtcdConfigStore) DeleteBlock ¶
func (s *EtcdConfigStore) DeleteBlock(ctx context.Context, id string) error
func (*EtcdConfigStore) DeleteServer ¶
func (s *EtcdConfigStore) DeleteServer(ctx context.Context, id string) error
func (*EtcdConfigStore) GetRetentionPolicy ¶
func (s *EtcdConfigStore) GetRetentionPolicy(ctx context.Context) (oproto.RetentionPolicy, error)
func (*EtcdConfigStore) GetServer ¶
func (s *EtcdConfigStore) GetServer(ctx context.Context, id string) (oproto.ClusterMember, error)
func (*EtcdConfigStore) Stop ¶
func (s *EtcdConfigStore) Stop() error
Stop shuts down the cluster link. This returns once the member has been stopped and has left the cluster.
func (*EtcdConfigStore) SubscribeChanges ¶
func (s *EtcdConfigStore) SubscribeChanges() (ConfigStoreWatcher, error)
func (*EtcdConfigStore) UnsubscribeChanges ¶
func (s *EtcdConfigStore) UnsubscribeChanges(ConfigStoreWatcher) error
func (*EtcdConfigStore) UpdateBlock ¶
func (*EtcdConfigStore) UpdateRetentionPolicy ¶
func (s *EtcdConfigStore) UpdateRetentionPolicy(ctx context.Context, policy oproto.RetentionPolicy) error
func (*EtcdConfigStore) UpdateServer ¶
func (s *EtcdConfigStore) UpdateServer(ctx context.Context, member oproto.ClusterMember) error
type LocalConfigStore ¶
type LocalConfigStore struct { Config *oproto.ClusterConfig // contains filtered or unexported fields }
func NewLocalConfigStore ¶
func NewLocalConfigStore(path, taskName string) *LocalConfigStore
func (*LocalConfigStore) DeleteBlock ¶
func (s *LocalConfigStore) DeleteBlock(ctx context.Context, id string) error
func (*LocalConfigStore) DeleteServer ¶
func (s *LocalConfigStore) DeleteServer(ctx context.Context, id string) error
func (*LocalConfigStore) GetClusterConfig ¶
func (s *LocalConfigStore) GetClusterConfig(ctx context.Context) *oproto.ClusterConfig
func (*LocalConfigStore) GetRetentionPolicy ¶
func (s *LocalConfigStore) GetRetentionPolicy(ctx context.Context) (oproto.RetentionPolicy, error)
func (*LocalConfigStore) GetServer ¶
func (s *LocalConfigStore) GetServer(ctx context.Context, id string) (oproto.ClusterMember, error)
func (*LocalConfigStore) GetTaskName ¶
func (s *LocalConfigStore) GetTaskName() string
func (*LocalConfigStore) GetThisServer ¶
func (s *LocalConfigStore) GetThisServer(ctx context.Context) oproto.ClusterMember
func (*LocalConfigStore) SetTaskName ¶
func (s *LocalConfigStore) SetTaskName(name string)
func (*LocalConfigStore) Stop ¶
func (s *LocalConfigStore) Stop() error
func (*LocalConfigStore) SubscribeChanges ¶
func (s *LocalConfigStore) SubscribeChanges() (ConfigStoreWatcher, error)
func (*LocalConfigStore) UnsubscribeChanges ¶
func (s *LocalConfigStore) UnsubscribeChanges(watcher ConfigStoreWatcher) error
func (*LocalConfigStore) UpdateBlock ¶
func (*LocalConfigStore) UpdateRetentionPolicy ¶
func (s *LocalConfigStore) UpdateRetentionPolicy(ctx context.Context, policy oproto.RetentionPolicy) error
func (*LocalConfigStore) UpdateServer ¶
func (s *LocalConfigStore) UpdateServer(ctx context.Context, member oproto.ClusterMember) error
func (*LocalConfigStore) UpdateThisState ¶
func (s *LocalConfigStore) UpdateThisState(ctx context.Context, state oproto.ClusterMember_State) error
UpdateThisState makes a change to the state of the current server and broadcasts it to the cluster.
type LocalConfigStoreWatcher ¶
type LocalConfigStoreWatcher struct {
// contains filtered or unexported fields
}
func (*LocalConfigStoreWatcher) Chan ¶
func (w *LocalConfigStoreWatcher) Chan() <-chan oproto.ClusterConfig
Click to show internal directories.
Click to hide internal directories.