guid

package
v0.4.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GUID

type GUID windows.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 stringification and marshaling can be supported. The representation matches that used by native Windows code.

func FromString

func FromString(s string) (*GUID, error)

FromString parses a string containing a GUID and returns the GUID. The only format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` format.

func NewV4

func NewV4() (*GUID, error)

NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122.

func (*GUID) MarshalJSON

func (g *GUID) MarshalJSON() ([]byte, error)

MarshalJSON marshals the GUID to JSON representation and returns it as a slice of bytes.

func (*GUID) String

func (g *GUID) String() string

func (*GUID) UnmarshalJSON

func (g *GUID) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a GUID from JSON representation and sets itself to the unmarshaled GUID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL