Documentation ¶
Index ¶
- func WithEventCallback(cb zk.EventCallback) zkConnOpt
- type Node
- func (n *Node) Deserialize(data []byte) error
- func (n *Node) Equal(other *Node) bool
- func (n *Node) GetAddress() (host string, port int)
- func (n *Node) GetAddressString() string
- func (n *Node) GetMeta(name string) (string, bool)
- func (n *Node) GetSeq() int
- func (n *Node) MemberStatus() *cluster.Member
- func (n *Node) Serialize() ([]byte, error)
- func (n *Node) SetMeta(name string, val string)
- type OnRoleChangedFunc
- type Option
- type Provider
- type RoleChangedListener
- type RoleType
- type SingletonScheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithEventCallback ¶
func WithEventCallback(cb zk.EventCallback) zkConnOpt
Types ¶
type Node ¶
type Node struct { ID string `json:"id"` Name string `json:"name"` Host string `json:"host"` Address string `json:"address"` Port int `json:"port"` Kinds []string `json:"kinds"` Meta map[string]string `json:"-"` Alive bool `json:"alive"` }
func (*Node) Deserialize ¶
func (*Node) GetAddress ¶
func (*Node) GetAddressString ¶
func (*Node) MemberStatus ¶
type OnRoleChangedFunc ¶
type OnRoleChangedFunc func(RoleType)
func (OnRoleChangedFunc) OnRoleChanged ¶
func (fn OnRoleChangedFunc) OnRoleChanged(rt RoleType)
type Option ¶
type Option func(*config)
func WithRoleChangedFunc ¶
func WithRoleChangedFunc(f OnRoleChangedFunc) Option
func WithRoleChangedListener ¶
func WithRoleChangedListener(l RoleChangedListener) Option
WithRoleChangedListener triggered on self role changed
func WithSessionTimeout ¶
WithSessionTimeout set zk session timeout
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) GetHealthStatus ¶
GetHealthStatus returns an error if the cluster health status has problems
type RoleChangedListener ¶
type RoleChangedListener interface {
OnRoleChanged(RoleType)
}
type SingletonScheduler ¶
func NewSingletonScheduler ¶
func NewSingletonScheduler(rc *actor.RootContext) *SingletonScheduler
func (*SingletonScheduler) FromFunc ¶
func (s *SingletonScheduler) FromFunc(f actor.ReceiveFunc) *SingletonScheduler
func (*SingletonScheduler) FromProducer ¶
func (s *SingletonScheduler) FromProducer(f actor.Producer) *SingletonScheduler
func (*SingletonScheduler) OnRoleChanged ¶
func (s *SingletonScheduler) OnRoleChanged(rt RoleType)
Click to show internal directories.
Click to hide internal directories.