Documentation ¶
Overview ¶
Package uuid provides a simple binding to the C-library libuuid.
Index ¶
- type Uuid
- func (uu *Uuid) Clear()
- func (uu Uuid) CompareTo(uu2 Uuid) int
- func (uu Uuid) Copy() (result Uuid)
- func (uu Uuid) CopyTo(uu2 *Uuid)
- func (uu *Uuid) Generate()
- func (uu *Uuid) GenerateRandom() error
- func (uu *Uuid) GenerateTime()
- func (uu *Uuid) GenerateTimeSafe()
- func (uu Uuid) IsNil() bool
- func (uu Uuid) String() string
- func (uu Uuid) ToGuid() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uuid ¶
type Uuid struct {
// contains filtered or unexported fields
}
Uuid holds the binary representation of a universally unique identifier (UUID).
func (*Uuid) Clear ¶
func (uu *Uuid) Clear()
Clear sets the value of the Uuid variable uu to the nil value.
func (Uuid) CompareTo ¶
CompareTo compares the two supplied Uuid variables uu and uu2 to each other. Returns an integer less than, equal to, or greater than zero if uu is found, respectively, to be lexicographically less than, equal, or greater than uu2.
func (*Uuid) Generate ¶
func (uu *Uuid) Generate()
Generate creates a new universally unique identifier (UUID). The UUID will be generated based on high-quality randomness generator. (i.e.from /dev/urandom), if available. If it is not available, then it will use an alternative algorithm which uses the current time, the local ethernet MAC address (if available), and random data generated using a pseudo-random generator.
func (*Uuid) GenerateRandom ¶
GenerateRandom forces the use of the all-random UUID format, even if a high-quality generator (i.e. /dev/urandom) is not available, in which case a pseudo-random generator will be substituted. Note that the use of a pseudo-random generator may compromise the uniqueness of UUIDs generated in this fasion.
func (*Uuid) GenerateTime ¶
func (uu *Uuid) GenerateTime()
GenerateTime furces the use of the alternative algorithm which uses the current time and the local ethernet MAC address, it can leak information about when and where the UUID was generated.
func (*Uuid) GenerateTimeSafe ¶
func (uu *Uuid) GenerateTimeSafe()
GenerateTimeSafe is similar to GenerateTime, except that it returns a value which denotes whether any of the synchronization mechanisms has been used.