Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegisterDiscover ¶
type RegisterDiscover interface { Quit() error AddObserver(event chan types.RoleType) error IsMaster() (bool, *types.ServerInfo, error) GetServers() ([]*types.ServerInfo, error) IsServerIP(ip string) (bool, error) Put(path string, data []byte) error Get(path string) ([]byte, error) Del(path string) error Run() error }
RegisterDiscover takes responsibility to register and elect a master, also watching the clusters change to notify the RoleChangeEvent.
func NewRegisterDiscover ¶
func NewRegisterDiscover(conf *config.ServerConfig) (RegisterDiscover, error)
NewRegisterDiscover : return server discover object
Click to show internal directories.
Click to hide internal directories.