idgen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package idgen generates stable, sortable IDs for DevSpecs artifacts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortID

func ShortID(sourceIdentity string) string

ShortID returns a deterministic 8-char hex string derived from sourceIdentity.

Types

type Factory

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

Factory generates DevSpecs IDs. It is safe for concurrent use.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new ID factory with a cryptographic entropy source.

func (*Factory) New

func (f *Factory) New() string

New generates a new DevSpecs ID in the form ds_<ULID>.

func (*Factory) NewWithPrefix

func (f *Factory) NewWithPrefix(prefix string) string

NewWithPrefix generates an ID with a custom prefix (e.g. "rev_", "src_").

Jump to

Keyboard shortcuts

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