uid

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrWrapper

func ErrWrapper(err Err) error

Types

type Err

type Err int
const (
	UnknownKeyType Err = iota
	IllegalKeyType
)

func (Err) String

func (i Err) String() string

type OptionFunc

type OptionFunc func(*generator)

func WithSnowflakeNodeId

func WithSnowflakeNodeId(NodeId int64) OptionFunc

type Uid

type Uid interface {
	Gen() (string, error)
}

func NewGenerator

func NewGenerator(keyType UidType, opts ...OptionFunc) (Uid, error)

type UidType

type UidType int
const (
	Snowflake UidType
	UuidV1
)

Directories

Path Synopsis
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package snowflake provides a very simple Twitter snowflake generator and parser.

Jump to

Keyboard shortcuts

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