id

package
v0.0.0-...-f5d76d0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadIdLength    = errors.New("id incorrect length")
	ErrPrefixNotFound = errors.New("id prefix doesn't exist")
)
View Source
var ErrPrefixExists = errors.New("id prefix already exists")

Functions

func IsValid

func IsValid(id Id) (bool, error)

func RegisterType

func RegisterType(typePrefix, typeKey string) error

Types

type Id

type Id string

func NewFromSequence

func NewFromSequence(prefix string, seq int64) (Id, error)

func (Id) Prefix

func (id Id) Prefix() string

type Registry

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

Jump to

Keyboard shortcuts

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