uuid

package
v0.69.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nil       = uuid.Nil
	MustParse = uuid.MustParse
)

Functions

func SetFakeUUID

func SetFakeUUID(t *testing.T, format string)

SetFakeUUID sets a fake UUID for testing. The 'format' is used to generate a fake UUID and must contain a single '%d' which will be replaced with a counter.

func SetFakeUUIDV7 added in v0.68.0

func SetFakeUUIDV7(t *testing.T, format string)

SetFakeUUIDV7 sets a fake UUID v7 for testing. The 'format' is used to generate a fake UUID and must contain a single '%d' which will be replaced with a counter.

Types

type UUID added in v0.50.0

type UUID = uuid.UUID

func New

func New() UUID

func NewV7 added in v0.68.0

func NewV7() (UUID, error)

NewV7 generates a new UUID version 7. UUIDv7 is time-ordered, combining a timestamp with random bits. This makes it suitable for use cases where ordering and database performance are important.

Jump to

Keyboard shortcuts

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