Documentation ¶
Index ¶
- type Etcd
- func (e *Etcd) Allocate(offset int) (bool, error)
- func (e *Etcd) AllocateNext() (int, bool, error)
- func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error
- func (e *Etcd) ForEach(fn func(int))
- func (e *Etcd) Free() int
- func (e *Etcd) Get() (*api.RangeAllocation, error)
- func (e *Etcd) Has(item int) bool
- func (e *Etcd) Release(item int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
Etcd exposes a service.Allocator TODO: allow multiple allocations to be tried at once TODO: subdivide the keyspace to reduce conflicts TODO: investigate issuing a CAS without reading first
func NewEtcd ¶
func NewEtcd(alloc allocator.Snapshottable, baseKey string, config *storagebackend.ConfigForResource) (*Etcd, error)
NewEtcd returns an allocator that is backed by Etcd and can manage persisting the snapshot state of allocation after each allocation is made.
func (*Etcd) AllocateNext ¶
AllocateNext attempts to allocate the next item.
func (*Etcd) CreateOrUpdate ¶
func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error
CreateOrUpdate attempts to update the current etcd state with the provided allocation.
Click to show internal directories.
Click to hide internal directories.