uuid

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package uuid is a utility package to standardize and abstract away how UUIDs are generated and used.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUUID = errio.Namespace("uuid").Code("invalid").ErrorPref("invalid uuid: %s")
)

Errors

Functions

func Equal

func Equal(a UUID, b UUID) bool

Equal returns true if both argument UUIDs contain the same value.

func Validate added in v0.23.0

func Validate(str string) error

Validate validates a uuid string is a valid UUID.

Types

type UUID

type UUID struct {
	gid.UUID
}

UUID is a wrapper around github.com/gofrs/uuid.UUID.

func FromString

func FromString(str string) (UUID, error)

FromString reads a UUID from a string

func New

func New() UUID

New generates a new UUID.

func (*UUID) IsZero added in v0.21.0

func (u *UUID) IsZero() bool

IsZero returns true if the UUID is equal to the zero-value.

func (*UUID) ToString

func (u *UUID) ToString() string

ToString converts UUID into string

Jump to

Keyboard shortcuts

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