Documentation ¶
Overview ¶
Package guid provides utilities to marshal and unmarshal GUIDs.
This representation of GUID is compatible with golang.org/x/sys/windows and can be used wherever syscall interface/func expects golang.org/x/sys/windows.GUID. Unlike github.com/google/uuid, encoding is always little endian.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GUID ¶
GUID represents a GUID/UUID.
It has the same structure as golang.org/x/sys/windows.GUID so that it can be used with functions expecting that type. It is defined as its own type so that fmt.Stringer, json.Marshaler, json.Unmarshaler, encoding.TextMarshaler and encoding.TextUnmarshaler can be supported. The representation matches that used by native Windows code.
func MustParseGUID ¶
MustParseGUID parses input as GUID, but upon errors panics.
func ParseGUID ¶
ParseGUID parses a string/byte slice containing a GUID and returns the GUID. The following formats are currently supported are
- `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
- `urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
func (GUID) AppendString ¶
AppendString appends hexadecimal encoded string representation of GUID to buf.
func (GUID) MarshalJSON ¶
MarshalText returns the text representation of the GUID.
func (GUID) MarshalText ¶
MarshalText returns the text representation of the GUID.
func (*GUID) UnmarshalJSON ¶
UnmarshalJSON takes the json representation of a GUID, and unmarshal it into this GUID.
func (*GUID) UnmarshalText ¶
UnmarshalText takes the text representation of a GUID, and unmarshal it into this GUID.