go-micro: github.com/micro/go-micro/sync/leader Index | Files | Directories

package leader

import "github.com/micro/go-micro/sync/leader"

Package leader provides leader election


Package Files

leader.go options.go

type ElectOption Uses

type ElectOption func(o *ElectOptions)

type ElectOptions Uses

type ElectOptions struct{}

type Elected Uses

type Elected interface {
    // id of leader
    Id() string
    // seek re-election
    Reelect() error
    // resign leadership
    Resign() error
    // observe leadership revocation
    Revoked() chan bool

type Leader Uses

type Leader interface {
    // elect leader
    Elect(id string, opts ...ElectOption) (Elected, error)
    // follow the leader
    Follow() chan string

Leader provides leadership election

type Option Uses

type Option func(o *Options)

func Group Uses

func Group(g string) Option

Group sets the group name for coordinating leadership

func Nodes Uses

func Nodes(a ...string) Option

Nodes sets the addresses of the underlying systems

type Options Uses

type Options struct {
    Nodes []string
    Group string



Package leader is imported by 12 packages. Updated 2020-01-30. Refresh now. Tools for package owners.