uuid

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nil = UUID(guuid.Nil)

Empty UUID, all zeros

Functions

This section is empty.

Types

type UUID

type UUID guuid.UUID

func FromBytes

func FromBytes(b []byte) (UUID, error)

FromBytes creates a new UUID from a byte slice. Returns an error if the slice does not have a length of 16. The bytes are copied from the slice.

func OfflinePlayerUUID

func OfflinePlayerUUID(username string) UUID

func Parse

func Parse(s string) (UUID, error)

Parse decodes s into a UUID or returns an error. Both the standard UUID forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

func ParseBytes

func ParseBytes(b []byte) (UUID, error)

ParseBytes is like Parse, except it parses a byte slice instead of a string.

func (UUID) MarshalJSON

func (i UUID) MarshalJSON() ([]byte, error)

func (UUID) String

func (i UUID) String() string

String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx , or "" if uuid is invalid.

func (UUID) Undashed

func (i UUID) Undashed() string

Undashed returns the undashed string form of the uuid.

Jump to

Keyboard shortcuts

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