Documentation ¶ Index ¶ Variables type Config type ElectionEvent type Registry func NewRegister(config Config) (Registry, error) type Role Constants ¶ This section is empty. Variables ¶ View Source var ( ErrInvalidAppId = errors.New("invalid app id") ErrInvalidHost = errors.New("invalid host of url") ErrInvalidPort = errors.New("invalid port of url") ErrUnsupportedProtocol = errors.New("invalid protocol of url") ) Functions ¶ This section is empty. Types ¶ type Config ¶ type Config struct { AppId string NodeId string Url util.URL // Election is the callback method which will be invoked while election event happened. Election func(event ElectionEvent, masterId string) } type ElectionEvent ¶ type ElectionEvent uint8 const ( MasterTake ElectionEvent = iota MasterLose ) type Registry ¶ type Registry interface { misc.Lifecycle misc.Sync misc.Type } func NewRegister ¶ func NewRegister(config Config) (Registry, error) type Role ¶ type Role uint8 const ( Slaver Role = iota Master ) Source Files ¶ View all Source files redis.go registry.go Click to show internal directories. Click to hide internal directories.