Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoLeader = errors.New("no leader") ErrNotLeader = errors.New("not a leader") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface { Close() error NewElection(ctx context.Context, electionKey string, id string) Election Register(ctx context.Context, serviceName string, instanceID string) error Discover(ctx context.Context, serviceName string) ([]string, error) }
func NewEtcdCluster ¶ added in v0.1.8
func NewRedisCluster ¶ added in v0.1.8
type ClusterRole ¶
type ClusterRole int
const ( RoleCandidate ClusterRole = iota RoleFollower ClusterRole = iota RoleLeader ClusterRole = iota )
func (ClusterRole) String ¶ added in v1.0.3
func (c ClusterRole) String() string
type RoleInfo ¶
type RoleInfo struct { Address string Role ClusterRole }
Click to show internal directories.
Click to hide internal directories.