Documentation
¶
Index ¶
Constants ¶
View Source
const ( UUID_VARIANT_RESERVED_NCS_BACKWARD_COMPATIBLE = 0x00 UUID_VARIANT_RESERVED_RFC_4122_NAMESPACE_DNS = 0x01 UUID_VARIANT_RESERVED_RFC_4122_NAMESPACE_URL = 0x02 UUID_VARIANT_RESERVED_RFC_4122_NAMESPACE_OID = 0x03 UUID_VARIANT_RESERVED_RFC_4122_NAMESPACE_X500 = 0x04 UUID_VARIANT_RESERVED_FUTURE_USE = 0x05 UUID_VARIANT_RESERVED_FOR_NCS_COMPATIBILITY = 0x06 UUID_VARIANT_RESERVED_FOR_FUTURE_USE = 0x07 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UUID ¶
type UUID struct {
// Version is the version of the UUID
Version uint8
// Variant is the variant of the UUID
Variant uint8
// Data is the data of the UUID
Data [15]byte
}
UUID represents a UUID structure
func (*UUID) FromString ¶
FromString parses a UUID string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and returns a UUID structure.
Parameters:
- s: A string representation of the UUID
Returns:
- An error if the string is not a valid UUID format
func (*UUID) Marshal ¶
Marshal converts a UUID structure into a 16-byte array
Returns:
- A byte slice containing the UUID's 16 bytes
- An error if the UUID is invalid or the conversion fails
type UUIDInterface ¶
type UUIDInterface interface {
// Marshal converts a UUID structure into a 16-byte array
Marshal() ([]byte, error)
// Unmarshal converts a 16-byte array into a UUID structure
Unmarshal(data []byte) (int, error)
// FromString parses a UUID string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
FromString(s string) error
// String returns the string representation of the UUID
String() string
}
UUIDInterface is an interface that defines the methods for a UUID
Click to show internal directories.
Click to hide internal directories.