Versions in this module Expand all Collapse all v0 v0.100.0 Nov 27, 2024 v0.99.0 Apr 22, 2024 v0.89.0 Sep 2, 2021 v0.88.0 Jul 16, 2020 v0.87.3 Jun 10, 2020 v0.87.2 Jun 1, 2020 v0.87.1 May 26, 2020 v0.86.1 Apr 24, 2020 Changes in this version + type IsConsistentFn func(item Item, itemAssignment keyspace.KeyValue, ...) bool type State + IsConsistent IsConsistentFn v0.85.2 Dec 4, 2019 v0.85.1 Dec 3, 2019 v0.84.2 Nov 6, 2019 v0.84.1 Oct 30, 2019 v0.83.2 Oct 4, 2019 v0.83.1 Oct 4, 2019 v0.82.2 Oct 4, 2019 v0.82.1 Sep 10, 2019 Changes in this version + const AssignmentsPrefix + const ItemsPrefix + const MembersPrefix + const Sep + const SepByte + func Allocate(args AllocateArgs) error + func AssignmentKey(ks *keyspace.KeySpace, a Assignment) string + func ItemAssignmentsPrefix(ks *keyspace.KeySpace, itemID string) string + func ItemKey(ks *keyspace.KeySpace, id string) string + func MemberKey(ks *keyspace.KeySpace, zone, suffix string) string + func NewAllocatorKeySpace(prefix string, decode Decoder) *keyspace.KeySpace + func NewAllocatorKeyValueDecoder(prefix string, decode Decoder) keyspace.KeyValueDecoder + func StartSession(args SessionArgs) error + type AllocateArgs struct + Context context.Context + Etcd *clientv3.Client + State *State + TestHook func(round int, isIdle bool) + type Announcement struct + Key string + Revision int64 + func Announce(etcd *clientv3.Client, key, value string, lease clientv3.LeaseID) *Announcement + func (a *Announcement) Update(value string) error + type Assignment struct + ItemID string + MemberSuffix string + MemberZone string + Slot int + type AssignmentValue interface + type Decoder interface + DecodeAssignment func(itemID, memberZone, memberSuffix string, slot int, raw *mvccpb.KeyValue) (AssignmentValue, error) + DecodeItem func(id string, raw *mvccpb.KeyValue) (ItemValue, error) + DecodeMember func(zone, suffix string, raw *mvccpb.KeyValue) (MemberValue, error) + type Item struct + ID string + func LookupItem(ks *keyspace.KeySpace, id string) (Item, bool) + type ItemValue interface + DesiredReplication func() int + IsConsistent func(assignment keyspace.KeyValue, allAssignments keyspace.KeyValues) bool + type LeftJoin struct + Compare func(l, r int) int + LenL int + LenR int + func (j *LeftJoin) Next() (LeftJoinCursor, bool) + type LeftJoinCursor struct + Left int + RightBegin int + RightEnd int + type LocalItem struct + Assignments keyspace.KeyValues + Index int + Item keyspace.KeyValue + type Member struct + Suffix string + Zone string + func LookupMember(ks *keyspace.KeySpace, zone, suffix string) (Member, bool) + type MemberValue interface + ItemLimit func() int + type SessionArgs struct + Etcd *clientv3.Client + LeaseTTL time.Duration + SignalCh <-chan os.Signal + Spec interface{ ... } + State *State + Tasks *task.Group + TestHook func(round int, isIdle bool) + type State struct + Assignments keyspace.KeyValues + ItemSlots int + Items keyspace.KeyValues + KS *keyspace.KeySpace + LocalItems []LocalItem + LocalKey string + LocalMemberInd int + MemberPrimaryCount []int + MemberSlots int + MemberTotalCount []int + Members keyspace.KeyValues + NetworkHash uint64 + ZoneSlots []int + Zones []string + func NewObservedState(ks *keyspace.KeySpace, localKey string) *State