Documentation
¶
Index ¶
- type Cluster
- type ClusterConfig
- type EmptyCluster
- func (c *EmptyCluster) Bootstrap() raft.Future
- func (c *EmptyCluster) GetLeader() string
- func (c *EmptyCluster) IsLeader() bool
- func (c *EmptyCluster) Join(a, b string) error
- func (c *EmptyCluster) Remove(a string) error
- func (c *EmptyCluster) Shutdown() raft.Future
- func (c *EmptyCluster) Start() error
- type EmptyFuture
- type MembershipManager
- type RaftCluster
- func (c *RaftCluster) Bootstrap() raft.Future
- func (c *RaftCluster) GetLeader() string
- func (c *RaftCluster) IsLeader() bool
- func (c *RaftCluster) Join(nodeID, addr string) error
- func (c *RaftCluster) Remove(nodeID string) error
- func (c *RaftCluster) Shutdown() raft.Future
- func (c *RaftCluster) Start() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface { Start() error Join(string, string) error Remove(string) error Bootstrap() raft.Future IsLeader() bool GetLeader() string Shutdown() raft.Future // contains filtered or unexported methods }
func NewCluster ¶
func NewCluster(config ClusterConfig) (Cluster, error)
func NewEmptyCluster ¶
func NewEmptyCluster() Cluster
type ClusterConfig ¶
type EmptyCluster ¶
type EmptyCluster struct { }
func (*EmptyCluster) Bootstrap ¶
func (c *EmptyCluster) Bootstrap() raft.Future
func (*EmptyCluster) GetLeader ¶
func (c *EmptyCluster) GetLeader() string
func (*EmptyCluster) IsLeader ¶
func (c *EmptyCluster) IsLeader() bool
func (*EmptyCluster) Join ¶
func (c *EmptyCluster) Join(a, b string) error
func (*EmptyCluster) Remove ¶
func (c *EmptyCluster) Remove(a string) error
func (*EmptyCluster) Shutdown ¶
func (c *EmptyCluster) Shutdown() raft.Future
func (*EmptyCluster) Start ¶
func (c *EmptyCluster) Start() error
type EmptyFuture ¶
type EmptyFuture struct { }
func (*EmptyFuture) Error ¶
func (e *EmptyFuture) Error() error
type MembershipManager ¶
type MembershipManager interface { Start() error Close() }
func GetManager ¶
func GetManager(config *ClusterConfig, cluster Cluster) (MembershipManager, error)
type RaftCluster ¶
type RaftCluster struct {
// contains filtered or unexported fields
}
func (*RaftCluster) Bootstrap ¶
func (c *RaftCluster) Bootstrap() raft.Future
func (*RaftCluster) GetLeader ¶
func (c *RaftCluster) GetLeader() string
func (*RaftCluster) IsLeader ¶
func (c *RaftCluster) IsLeader() bool
func (*RaftCluster) Join ¶
func (c *RaftCluster) Join(nodeID, addr string) error
func (*RaftCluster) Remove ¶
func (c *RaftCluster) Remove(nodeID string) error
func (*RaftCluster) Shutdown ¶
func (c *RaftCluster) Shutdown() raft.Future
func (*RaftCluster) Start ¶
func (c *RaftCluster) Start() error
Click to show internal directories.
Click to hide internal directories.