Documentation ¶
Index ¶
- Constants
- Variables
- func CalWeight(mul int) int
- func NewSugar() *zap.SugaredLogger
- type Atlas
- type Config
- type ConflictDelegate
- type Consistent
- type Delegate
- type EventDelegate
- type Libra
- type Map
- func (m *Map) Add(s *Star)
- func (m *Map) Collect()
- func (m *Map) Del(s *Star)
- func (m *Map) Diff(o *Map) (add, del []*Star)
- func (m *Map) Get(name string) *Star
- func (m *Map) Has(name string) bool
- func (m *Map) HasStar(s *Star) bool
- func (m *Map) Len() int
- func (m *Map) ListName() []string
- func (m *Map) ListStar() []*Star
- type Poll
- type Star
Constants ¶
View Source
const ( MinMultiplier = 1 MaxMultiplier = 1 << 4 // max weight = 32 )
Variables ¶
Functions ¶
func NewSugar ¶
func NewSugar() *zap.SugaredLogger
Types ¶
type ConflictDelegate ¶
type ConflictDelegate struct{}
type Consistent ¶
Consistent simple consistent hashing https://en.wikipedia.org/wiki/Consistent_hashing
func (*Consistent) Add ¶
func (c *Consistent) Add(stars ...*Star)
func (*Consistent) Del ¶
func (c *Consistent) Del(stars ...*Star)
func (*Consistent) Get ¶
func (c *Consistent) Get(keys ...string) *Atlas
func (*Consistent) Len ¶
func (c *Consistent) Len() int
func (*Consistent) Update ¶
func (c *Consistent) Update(star *Star) error
type Delegate ¶
type Delegate struct {
*ml.Memberlist
}
func (*Delegate) GetBroadcasts ¶
func (*Delegate) LocalState ¶
func (*Delegate) MergeRemoteState ¶
type EventDelegate ¶
func (*EventDelegate) NotifyJoin ¶
func (ed *EventDelegate) NotifyJoin(n *ml.Node)
func (*EventDelegate) NotifyLeave ¶
func (ed *EventDelegate) NotifyLeave(n *ml.Node)
func (*EventDelegate) NotifyUpdate ¶
func (ed *EventDelegate) NotifyUpdate(n *ml.Node)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.