id

package
v0.0.0-...-3a1a44b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

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