euuid

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUUID

func IsUUID(uuid string) bool

Types

type UUID

type UUID interface {
	fmt.Stringer

	// Urn returns URN form like `urn:uuid:123e4567-e89b-12d3-a456-426655440000`.
	Urn() string

	// Version of UUID
	Version() Version

	// Variant of UUID
	Variant() Variant

	// IsNil true if the UUID is zero
	IsNil() bool

	// Equals true if same value
	Equals(x UUID) bool
}

func New

func New(data []byte) (UUID, eoutcome.ParseOutcome)

func NewV4

func NewV4() UUID

func Parse

func Parse(uuid string) (u UUID, outcome eoutcome.ParseOutcome)

type Variant

type Variant int
const (
	Variant0 Variant = iota
	Variant1
	Variant2
	VariantReserved
)

type Version

type Version int
const (
	// Version1 Date-time and MAC address
	Version1 Version = iota + 1

	// Version2 Date-time and MAC address, DCE security version
	Version2

	// Version3 Namespace name-based (MD5)
	Version3

	// Version4 Random UUID
	Version4

	// Version5 Namespace name-based (SHA1)
	Version5
)

Jump to

Keyboard shortcuts

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