import "github.com/gobuffalo/uuid"
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).
codec.go generator.go sql.go uuid.go
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.
Size of a UUID in bytes.
var ( NamespaceDNS = guuid.NamespaceDNS NamespaceURL = guuid.NamespaceURL NamespaceOID = guuid.NamespaceOID NamespaceX500 = guuid.NamespaceX500 )
Predefined namespace UUIDs.
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.
NewV1 returns UUID based on current timestamp and MAC address.
NewV2 returns DCE Security UUID based on POSIX UID/GID.
NewV3 returns UUID based on MD5 hash of namespace UUID and name.
NewV4 returns random generated UUID.
NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.
Nil is special form of UUID that is specified to have all 128 bits set to zero.
Generator provides interface for generating UUIDs.
NullUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database
UUID representation compliant with specification described in RFC 4122.
Must is a helper that wraps a call to a function returning (UUID, error) and panics if the error is non-nil. It is intended for use in variable initializations such as
var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000"));
Package uuid imports 1 packages (graph) and is imported by 45 packages. Updated 2019-05-01. Refresh now. Tools for package owners.