Versions in this module Expand all Collapse all v0 v0.3.0 Oct 8, 2026 Changes in this version + const SegmentTypeParam type SegmentConfig + Pattern string v0.2.0 Sep 11, 2026 Changes in this version + const CharsetAlpha + const CharsetAlphanumeric + const CharsetNumeric + const SegmentTypeDate + const SegmentTypeList + const SegmentTypeLiteral + const SegmentTypeRandom + const SegmentTypeSequence + var ErrRandomCollision = errors.New("refid: random value already reserved for this scope") + var ErrRandomExhausted = errors.New("refid: random segment exhausted attempts without finding an unreserved value") + type RandomSegmentConfig struct + Charset string + Length int + MaxAttempts int + ScopeKey string + type RandomStore interface + Reserve func(ctx context.Context, scopeKey, value string) error + type RegistryOption func(*registryConfig) + func WithRandomStore(store RandomStore) RegistryOption + func WithSequenceStore(store SequenceStore) RegistryOption type SegmentConfig + Random *RandomSegmentConfig + Sequence *SequenceSegmentConfig + type SequenceSegmentConfig struct + Padding int + ScopeKey string v0.1.0 Sep 6, 2026 Changes in this version + var ErrCounterOverflow = errors.New("refid: sequence counter exceeds padding width") + var ErrInvalidParam = errors.New("refid: invalid or missing param") + var ErrUnknownIDType = errors.New("refid: unknown id type") + var ErrUnknownIssuer = errors.New("refid: unknown issuer") + type Config struct + Issuers []IssuerConfig + Lists map[string][]string + func LoadConfig(path string) (Config, error) + type FormatConfig struct + IDType string + Segments []SegmentConfig + type IssuerConfig struct + Formats []FormatConfig + Issuer string + type Registry interface + Generate func(ctx context.Context, issuer, idType string, params map[string]string) (string, error) + func NewRegistry(cfg Config, store SequenceStore) (Registry, error) + type SegmentConfig struct + Layout string + List string + Padding int + Param string + ScopeKey string + Type string + Value string + type SequenceStore interface + Next func(ctx context.Context, scopeKey string, max int64) (int64, error)