id

package
v0.0.0-...-1b41ab9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFormat = errors.New("not valid ID format")

Functions

This section is empty.

Types

type ID

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

func FromBytes

func FromBytes(bts [16]byte) *ID

func FromInt64

func FromInt64(high, low int64) *ID

func FromString

func FromString(id string, sep byte) (*ID, error)

func (*ID) Bytes

func (id *ID) Bytes() [16]byte

func (*ID) Int64

func (id *ID) Int64() (high, low int64)

func (*ID) String

func (id *ID) String(sep byte) string

type IDFlaker

type IDFlaker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewIDFlaker

func NewIDFlaker() *IDFlaker

func (*IDFlaker) NextID

func (flk *IDFlaker) NextID() *ID

type IDs

type IDs []*ID

func (IDs) Len

func (ids IDs) Len() int

func (IDs) Less

func (ids IDs) Less(i, j int) bool

func (IDs) Swap

func (ids IDs) Swap(i, j int)

Jump to

Keyboard shortcuts

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