shortid

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Setting added in v0.0.15

type Setting = sonyflake.Settings

type Sonyflake

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

func New

func New(ss ...*Setting) *Sonyflake

New creates a new Sonyflake generator with a unique node.

func (Sonyflake) Gen

func (s Sonyflake) Gen() string

Gen generates a new Sonyflake ID as a string.

func (Sonyflake) Name

func (s Sonyflake) Name() string

Name returns the name of the generator.

func (Sonyflake) Size

func (s Sonyflake) Size() int

Size returns the bit size of the generated Sonyflake ID.

func (Sonyflake) Validate

func (s Sonyflake) Validate(id string) bool

Validate checks if the provided ID is a valid Sonyflake ID.

Jump to

Keyboard shortcuts

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