uuid

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 8 Imported by: 4

README

uuid

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespaceDNS  = Must(Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceURL  = Must(Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceOID  = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
)
View Source
var (
	Nil = UUID{}
)

Functions

func Equal

func Equal(a UUID, b UUID) bool

func MakeV3

func MakeV3(ns UUID, name string) string

func MakeV4

func MakeV4() string

func MakeV5

func MakeV5(ns UUID, name string) string

Types

type UUID

type UUID [16]byte

The UUID represents a Universally Unique Identifier.

func Must

func Must(u UUID, err error) UUID

func NewV3

func NewV3(ns UUID, name string) UUID

func NewV4

func NewV4() UUID

func NewV5

func NewV5(ns UUID, name string) UUID

func Parse

func Parse(raw string) (UUID, error)

func (UUID) Bytes

func (u UUID) Bytes() []byte

func (UUID) MarshalText

func (u UUID) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by String.

func (UUID) String

func (u UUID) String() string

Returns canonical string representation of UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

func (*UUID) UnmarshalText

func (u *UUID) UnmarshalText(text []byte) (err error)

UnmarshalText implements the encoding.TextUnmarshaler interface. Following formats are supported: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8"

func (UUID) Variant

func (u UUID) Variant() Variant

func (UUID) Version

func (u UUID) Version() uint8

type Variant

type Variant uint8
const (
	VariantNCS Variant = iota
	VariantRFC4122
	VariantMicrosoft
	VariantFuture
)

UUID layout variants

Jump to

Keyboard shortcuts

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