Documentation ¶
Overview ¶
Package uuid provides implementation of Universally Unique Identifier (UUID). Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and version 2 (as specified in DCE 1.1).
Index ¶
Constants ¶
UUID versions
const ( VariantNCS = guuid.VariantNCS VariantRFC4122 = guuid.VariantRFC4122 VariantMicrosoft = guuid.VariantMicrosoft VariantFuture = guuid.VariantFuture )
UUID layout variants.
const ( DomainPerson = guuid.DomainPerson DomainGroup = guuid.DomainGroup DomainOrg = guuid.DomainOrg )
UUID DCE domains.
const Size = guuid.Size
Size of a UUID in bytes.
Variables ¶
var ( NamespaceDNS = guuid.NamespaceDNS NamespaceURL = guuid.NamespaceURL NamespaceOID = guuid.NamespaceOID NamespaceX500 = guuid.NamespaceX500 )
Predefined namespace UUIDs.
var FromBytes = guuid.FromBytes
FromBytes returns UUID converted from raw byte slice input. It will return error if the slice isn't 16 bytes long.
var FromBytesOrNil = guuid.FromBytesOrNil
FromBytesOrNil returns UUID converted from raw byte slice input. Same behavior as FromBytes, but returns a Nil UUID on error.
var FromString = guuid.FromString
FromString returns UUID parsed from string input. Input is expected in a form accepted by UnmarshalText.
var FromStringOrNil = guuid.FromStringOrNil
FromStringOrNil returns UUID parsed from string input. Same behavior as FromString, but returns a Nil UUID on error.
var NewV1 = guuid.NewV1
NewV1 returns UUID based on current timestamp and MAC address.
var NewV2 = guuid.NewV2
NewV2 returns DCE Security UUID based on POSIX UID/GID.
var NewV3 = guuid.NewV3
NewV3 returns UUID based on MD5 hash of namespace UUID and name.
var NewV4 = guuid.NewV4
NewV4 returns random generated UUID.
var NewV5 = guuid.NewV5
NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.
var Nil = guuid.Nil
Nil is special form of UUID that is specified to have all 128 bits set to zero.
Functions ¶
This section is empty.
Types ¶
type NullUUID ¶ added in v1.1.0
NullUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database
type UUID ¶
UUID representation compliant with specification described in RFC 4122.