uuid

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

UUID identity provider

The UUID identity provider generates a random, universally unique identifier (UUID), unique for all practical purposes.

Documentation

Overview

Package uuid provides a UUID identity provider.

Index

Constants

View Source
const Prefix = "123e4567-e89b-12d3-a456-"

Prefix represents the prefix used to generate UUID mocks

Variables

View Source
var ErrGeneratingID = errors.New("failed to generate uuid")

ErrGeneratingID indicates error in generating UUID

Functions

func ParseID added in v0.23.0

func ParseID(ID string) (id uint64)

Types

type IDProvider

type IDProvider interface {
	// ID generates the unique identifier.
	ID() (string, error)
}

IDProvider specifies an API for generating unique identifiers.

func New

func New() IDProvider

New instantiates a UUID provider.

func NewMock

func NewMock() IDProvider

NewMock creates "mirror" uuid provider, i.e. generated token will hold value provided by the caller.

Jump to

Keyboard shortcuts

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