flakeid

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoBatcher

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

func NewAutoBatcher

func NewAutoBatcher(batchSize int32, validity int64, supplier IDBatchSupplier) *AutoBatcher

func (*AutoBatcher) NewID

func (b *AutoBatcher) NewID() (int64, error)

type Block

type Block struct {
	IDBatch *IDBatch
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(idBatch *IDBatch, validityMillis int64) *Block

type IDBatch

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

func NewIDBatch

func NewIDBatch(base int64, increment int64, batchSize int32) *IDBatch

func (*IDBatch) Base

func (b *IDBatch) Base() int64

func (*IDBatch) BatchSize

func (b *IDBatch) BatchSize() int32

func (*IDBatch) Increment

func (b *IDBatch) Increment() int64

type IDBatchSupplier

type IDBatchSupplier interface {
	NewIDBatch(batchSize int32) (*IDBatch, error)
}

Jump to

Keyboard shortcuts

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