id

package
v0.0.0-...-2097cc5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDLength        = 26
	SafeShortLength = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator creates and resolves task IDs.

func NewGenerator

func NewGenerator(clk clock.Clock) *Generator

func (*Generator) New

func (g *Generator) New() ID

func (*Generator) Resolve

func (g *Generator) Resolve(input string, candidates []*ID) (*ID, error)

type ID

type ID string

func New

func New(now time.Time) ID

New creates a fresh identifier backed by a ULID.

func Parse

func Parse(input string) (ID, error)

func (ID) Matches

func (id ID) Matches(input string) bool

func (ID) Short

func (id ID) Short(n int) string

func (ID) String

func (id ID) String() string

Jump to

Keyboard shortcuts

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