unique

package
Version: v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 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 (
	UnknownErrCode Err = iota
	IllegalKeyType
)

func (Err) String

func (i Err) String() string

type Generator

type Generator interface {
	UniqueKey(KeyType) (string, error)
}

func NewGenerator

func NewGenerator(opts ...Option) (Generator, error)

type KeyType

type KeyType int
const (
	Snowflake KeyType = iota
	UuidV1
)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithSnowflakeNodeId

func WithSnowflakeNodeId(NodeId int64) Option

Directories

Path Synopsis
provider
snowflake
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
t or T : Toggle theme light dark auto
y or Y : Canonical URL