ulid

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ulid provides a ULID (Universally Unique Lexicographically Sortable Identifier) implementation.

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 struct {
}

type ULID

type ULID struct{}

ULID is a struct that implements the ident.Identifier interface.

func New

func New(_ ...Setting) *ULID

New creates a new ULID implementation.

func (ULID) Gen

func (U ULID) Gen() string

Gen generates a new ULID string. It implements the ident.Identifier interface.

func (ULID) Name

func (U ULID) Name() string

Name returns the name of the ULID implementation. It implements the ident.Identifier interface.

func (ULID) Size

func (U ULID) Size() int

Size returns the size of a ULID string in bits. It implements the ident.Identifier interface.

func (ULID) Validate

func (U ULID) Validate(id string) bool

Validate checks if the given ID is a valid ULID. It implements the ident.Identifier interface.

Jump to

Keyboard shortcuts

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