Documentation ¶
Index ¶
- Constants
- Variables
- 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 = Domain(dcesecurity.User) // POSIX UID domain DomainGroup = Domain(dcesecurity.Group) // POSIX GID domain )
Domains.
View Source
const ( LayoutInvalid = Layout(layout.Invalid) // Invalid LayoutNCS = Layout(layout.NCS) // Reserved, NCS backward compatibility. (Values: 0x00-0x07) LayoutRFC4122 = Layout(layout.RFC4122) // The variant specified in RFC 4122. (Values: 0x08-0x0b) LayoutMicrosoft = Layout(layout.Microsoft) // Reserved, Microsoft Corporation backward compatibility. (Values: 0x0c-0x0d) LayoutFuture = Layout(layout.Future) // Reserved for future definition. (Values: 0x0e-0x0f) )
Layouts.
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" )
Imports namespaces.
View Source
const ( VersionUnknown = Version(version.Unknown) // Unknown VersionTimeBased = Version(version.TimeBased) // V1: The time-based version VersionDCESecurity = Version(version.DCESecurity) // V2: The DCE security version, with embedded POSIX UIDs VersionNameBasedMD5 = Version(version.NameBasedMD5) // V3: The name-based version that uses MD5 hashing VersionRandom = Version(version.Random) // V4: The randomly or pseudo-randomly generated version VersionNameBasedSHA1 = Version(version.NameBasedSHA1) // V5: The name-based version that uses SHA-1 hashing )
Versions.
View Source
const ( V1 = VersionTimeBased V2 = VersionDCESecurity V3 = VersionNameBasedMD5 V4 = VersionRandom V5 = VersionNameBasedSHA1 )
Short names.
Variables ¶
View Source
var (
Nil = UUID{} // Nil UUID
)
Functions ¶
This section is empty.
Types ¶
type Style ¶
type Style byte
Style represents the style of UUID string.
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.