Documentation
¶
Index ¶
- type RStorage
- func (s *RStorage) AddVoter(address string) error
- func (s *RStorage) Apply(logEntry *raft.Log) interface{}
- func (s *RStorage) DistributeConfig() error
- func (s *RStorage) Get(key string) ([]byte, error)
- func (s *RStorage) GetClusterServers() ([]raft.Server, error)
- func (s *RStorage) JoinCluster(leaderHTTPAddress string) error
- func (s *RStorage) Put(key string, value config.ServerConfig) error
- func (s *RStorage) RequestConfigFromLeader() error
- func (s *RStorage) Restore(serialized io.ReadCloser) error
- func (s *RStorage) Set(key string, value []byte) error
- func (s *RStorage) SetLocalConfig(encodedConfig []byte) error
- func (s *RStorage) Snapshot() (raft.FSMSnapshot, error)
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RStorage ¶
type RStorage struct {
RaftNode *raft.Raft
Config StorageConfig
// contains filtered or unexported fields
}
RStorage represents key-value storage with raft based replication Also, it represents finite-state machine which processes Raft log events
func NewRStorage ¶
func NewRStorage(config *StorageConfig) (*RStorage, error)
NewRStorage initiates a new RStorage node
func (*RStorage) DistributeConfig ¶
func (*RStorage) GetClusterServers ¶
GetClusterServers returns all cluster's servers
func (*RStorage) JoinCluster ¶
JoinCluster sends a POST request to "join" address to ask the cluster leader join this node as a voter
func (*RStorage) RequestConfigFromLeader ¶
func (*RStorage) Restore ¶
func (s *RStorage) Restore(serialized io.ReadCloser) error
Restore stores the key-value store to a previous state.
func (*RStorage) SetLocalConfig ¶
Click to show internal directories.
Click to hide internal directories.