id

package
v4.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator interface {
	Alloc() (uint64, error)
}

Allocator is the allocator to generate unique ID.

type AllocatorImpl

type AllocatorImpl struct {
	// contains filtered or unexported fields
}

AllocatorImpl is used to allocate ID.

func NewAllocatorImpl

func NewAllocatorImpl(client *clientv3.Client, rootPath string, member string) *AllocatorImpl

NewAllocatorImpl creates a new IDAllocator.

func (*AllocatorImpl) Alloc

func (alloc *AllocatorImpl) Alloc() (uint64, error)

Alloc returns a new id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL