id

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTxnPutEndID = coderr.NewCodeError(coderr.Internal, "put end id in txn")
	ErrAllocID     = coderr.NewCodeError(coderr.Internal, "alloc id")
)

Functions

This section is empty.

Types

type Allocator

type Allocator interface {
	// Alloc allocs a unique id.
	Alloc(ctx context.Context) (uint64, error)
}

Allocator defines the id allocator on the ceresdb cluster meta info.

type AllocatorImpl

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

func NewAllocatorImpl

func NewAllocatorImpl(kv clientv3.KV, key string, allocStep uint) *AllocatorImpl

func (*AllocatorImpl) Alloc

func (a *AllocatorImpl) Alloc(ctx context.Context) (uint64, error)

Jump to

Keyboard shortcuts

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