Documentation ¶
Index ¶
- Constants
- func ResemblesUUID(s string) bool
- type UUID
- func (u UUID) Bytes() []byte
- func (u UUID) Compare(c sort.Comparable) int
- func (u UUID) IsZero() bool
- func (u UUID) MarshalBinary() ([]byte, error)
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) MarshalText() ([]byte, error)
- func (u UUID) Node() []byte
- func (v *UUID) Scan(src interface{}) error
- func (u UUID) String() string
- func (u UUID) Time() time.Time
- func (u UUID) Timestamp() int64
- func (u *UUID) UnmarshalBinary(data []byte) error
- func (u *UUID) UnmarshalJSON(data []byte) error
- func (u *UUID) UnmarshalText(data []byte) error
- func (v UUID) Value() (driver.Value, error)
- func (u UUID) Variant() int
- func (u UUID) Version() int
Constants ¶
const ( VariantNCSCompat = 0 VariantIETF = 2 VariantMicrosoft = 6 VariantFuture = 7 )
Variables ¶
This section is empty.
Functions ¶
func ResemblesUUID ¶
Determine if an input string resembles a UUID
Types ¶
type UUID ¶
type UUID [16]byte
func BaseFromTime ¶
UUIDBaseFromTime generates a new time based UUID (version 1) in the same manner as UUIDFromTime with the exception that the clock sequence component is zeroed. This allows for the construction of a time UUID that represents the lower bound of any other UUID that could be generated for the same time.
func FromTime ¶
UUIDFromTime generates a new time based UUID (version 1) as described in RFC 4122. This UUID contains the MAC address of the node that generated the UUID, the given timestamp and a sequence number.
func (UUID) Bytes ¶
Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits (16 bytes) long.
func (UUID) Compare ¶
func (u UUID) Compare(c sort.Comparable) int
Lexically compare this UUID to another UUID
func (UUID) MarshalBinary ¶
func (UUID) MarshalJSON ¶
func (UUID) MarshalText ¶
func (UUID) Node ¶
Node extracts the MAC address of the node who generated this UUID. It will return nil if the UUID is not a time based UUID (version 1).
func (UUID) String ¶
String returns the UUID in it's canonical form, a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
func (UUID) Timestamp ¶
Timestamp extracts the timestamp information from a time based UUID (version 1).