Documentation
¶
Index ¶
- Constants
- Variables
- type Backend
- type Config
- type Election
- type KVPair
- type KVStore
- type Store
- func (s *Store) AtomicPutClusterData(ctx context.Context, cd *cluster.ClusterData, previous *KVPair) (*KVPair, error)
- func (s *Store) GetClusterData(ctx context.Context) (*cluster.ClusterData, *KVPair, error)
- func (s *Store) GetKeeperInfo(ctx context.Context, id string) (*cluster.KeeperInfo, bool, error)
- func (s *Store) GetKeepersInfo(ctx context.Context) (cluster.KeepersInfo, error)
- func (s *Store) GetLeaderSentinelId(ctx context.Context) (string, error)
- func (s *Store) GetProxiesInfo(ctx context.Context) (cluster.ProxiesInfo, error)
- func (s *Store) GetProxyInfo(ctx context.Context, id string) (*cluster.ProxyInfo, bool, error)
- func (s *Store) GetSentinelInfo(ctx context.Context, id string) (*cluster.SentinelInfo, bool, error)
- func (s *Store) GetSentinelsInfo(ctx context.Context) (cluster.SentinelsInfo, error)
- func (s *Store) PutClusterData(ctx context.Context, cd *cluster.ClusterData) error
- func (s *Store) SetKeeperInfo(ctx context.Context, id string, ms *cluster.KeeperInfo, ttl time.Duration) error
- func (s *Store) SetProxyInfo(ctx context.Context, pi *cluster.ProxyInfo, ttl time.Duration) error
- func (s *Store) SetSentinelInfo(ctx context.Context, si *cluster.SentinelInfo, ttl time.Duration) error
- type WriteOptions
Constants ¶
View Source
const ( DefaultEtcdEndpoints = "http://127.0.0.1:2379" DefaultConsulEndpoints = "http://127.0.0.1:8500" )
View Source
const ( //TODO(sgotti) fix this in libkv? // consul min ttl is 10s and libkv divides this by 2 MinTTL = 20 * time.Second )
Variables ¶
View Source
var ( // ErrKeyNotFound is thrown when the key is not found in the store during a Get operation ErrKeyNotFound = errors.New("Key not found in store") ErrKeyModified = errors.New("Unable to complete atomic operation, key modified") ErrElectionNoLeader = errors.New("election: no leader") )
View Source
var URLSchemeRegexp = regexp.MustCompile(`^([a-zA-Z][a-zA-Z0-9+-.]*)://`)
Functions ¶
This section is empty.
Types ¶
type Election ¶ added in v0.8.0
type Election interface { // TODO(sgotti) this mimics the current docker/leadership API and the etcdv3 // implementations adapt to it. In future it could be replaced with a better // api like the current one implemented by etcdclientv3/concurrency. RunForElection() (<-chan bool, <-chan error) Leader() (string, error) Stop() }
func NewElection ¶ added in v0.8.0
type KVStore ¶ added in v0.8.0
type KVStore interface { // Put a value at the specified key Put(ctx context.Context, key string, value []byte, options *WriteOptions) error // Get a value given its key Get(ctx context.Context, key string) (*KVPair, error) // List the content of a given prefix List(ctx context.Context, directory string) ([]*KVPair, error) // Atomic CAS operation on a single value. // Pass previous = nil to create a new key. AtomicPut(ctx context.Context, key string, value []byte, previous *KVPair, options *WriteOptions) (*KVPair, error) Delete(ctx context.Context, key string) error // Close the store connection Close() error }
func NewKVStore ¶ added in v0.8.0
type Store ¶ added in v0.8.0
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AtomicPutClusterData ¶ added in v0.8.0
func (*Store) GetClusterData ¶ added in v0.8.0
func (*Store) GetKeeperInfo ¶ added in v0.8.0
func (*Store) GetKeepersInfo ¶ added in v0.8.0
func (*Store) GetLeaderSentinelId ¶ added in v0.8.0
func (*Store) GetProxiesInfo ¶ added in v0.8.0
func (*Store) GetProxyInfo ¶ added in v0.8.0
func (*Store) GetSentinelInfo ¶ added in v0.8.0
func (*Store) GetSentinelsInfo ¶ added in v0.8.0
func (*Store) PutClusterData ¶ added in v0.8.0
func (*Store) SetKeeperInfo ¶ added in v0.8.0
func (*Store) SetProxyInfo ¶ added in v0.8.0
func (*Store) SetSentinelInfo ¶ added in v0.8.0
type WriteOptions ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.