Documentation
¶
Overview ¶
Package uuid implements UUID described in RFC 4122.
Index ¶
- Constants
- Variables
- func IsValid(uuid string) bool
- type Domain
- type Layout
- type Style
- type UUID
- func New() (UUID, error)
- func NewDCESecurity(domain Domain) (UUID, error)
- func NewNameBasedMD5(namespace, name string) (UUID, error)
- func NewNameBasedSHA1(namespace, name string) (UUID, error)
- func NewRandom() (UUID, error)
- func NewTimeBased() (UUID, error)
- func NewV1() (UUID, error)
- func NewV2(domain Domain) (UUID, error)
- func NewV3(namespace, name string) (UUID, error)
- func NewV4() (UUID, error)
- func NewV5(namespace, name string) (UUID, error)
- func Parse(str string) (UUID, error)
- type Version
Constants ¶
View Source
const ( // DomainUser represents POSIX UID domain. DomainUser = Domain(dcesecurity.User) // DomainGroup represents POSIX GID domain. DomainGroup = Domain(dcesecurity.Group) )
View Source
const ( // LayoutInvalid represents invalid layout. LayoutInvalid = Layout(internal.LayoutInvalid) // LayoutNCS represents the layout: Reserved, NCS backward compatibility. LayoutNCS = Layout(internal.LayoutNCS) // LayoutRFC4122 represents the layout: The variant specified in RFC 4122. LayoutRFC4122 = Layout(internal.LayoutRFC4122) // LayoutMicrosoft represents the layout: Reserved, Microsoft Corporation backward compatibility. LayoutMicrosoft = Layout(internal.LayoutMicrosoft) // LayoutFuture represents the layout: Reserved for future definition. LayoutFuture = Layout(internal.LayoutFuture) )
View Source
const ( NamespaceDNS = namebased.NamespaceDNS // "6ba7b810-9dad-11d1-80b4-00c04fd430c8" NamespaceURL = namebased.NamespaceURL // "6ba7b811-9dad-11d1-80b4-00c04fd430c8" NamespaceOID = namebased.NamespaceOID // "6ba7b812-9dad-11d1-80b4-00c04fd430c8" NamespaceX500 = namebased.NamespaceX500 // "6ba7b814-9dad-11d1-80b4-00c04fd430c8" )
Standard Namespaces.
View Source
const ( // VersionUnknown represents unknown version. VersionUnknown = Version(internal.VersionUnknown) // VersionTimeBased represents the time-based version (Version 1). VersionTimeBased = Version(internal.VersionTimeBased) // VersionDCESecurity represents the DCE security version, with embedded POSIX UIDs (Version 2). VersionDCESecurity = Version(internal.VersionDCESecurity) // VersionNameBasedMD5 represents the name-based version that uses MD5 hashing (Version 3). VersionNameBasedMD5 = Version(internal.VersionNameBasedMD5) // VersionRandom represents the randomly or pseudo-randomly generated version (Version 4). VersionRandom = Version(internal.VersionRandom) // VersionNameBasedSHA1 represents the name-based version that uses SHA-1 hashing (Version 5). VersionNameBasedSHA1 = Version(internal.VersionNameBasedSHA1) )
Versions.
View Source
const ( V1 = VersionTimeBased V2 = VersionDCESecurity V3 = VersionNameBasedMD5 V4 = VersionRandom V5 = VersionNameBasedSHA1 )
Short names of versions.
Variables ¶
View Source
var ( // Nil represents the Nil UUID (00000000-0000-0000-0000-000000000000). Nil = UUID{} )
Functions ¶
Types ¶
type UUID ¶
type UUID [16]byte
UUID respresents an UUID type compliant with specification in RFC 4122.
func NewDCESecurity ¶
NewDCESecurity returns a new DCE security UUID (version 2).
func NewNameBasedMD5 ¶
NewNameBasedMD5 returns a new name based UUID with MD5 hash (version 3).
func NewNameBasedSHA1 ¶
NewNameBasedSHA1 returns a new name based UUID with SHA1 hash (version 5).
func NewTimeBased ¶
NewTimeBased returns a new time based UUID (version 1).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.