uuid

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: BSD-3-Clause Imports: 3 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID [16]byte

UUID (universally unique identifier) is a 128-bit number used to identify information in computer systems as defined in RFC 4122.

func FromBytes added in v1.2.0

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 NewUUID

func NewUUID() UUID

func ParseUUID

func ParseUUID(s string) (UUID, error)

func (UUID) MarshalBinary added in v1.2.0

func (u UUID) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (UUID) MarshalText

func (u UUID) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (UUID) String

func (u UUID) String() string

String returns uuid string representation "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" or "" if uuid is invalid.

func (*UUID) UnmarshalBinary added in v1.2.0

func (u *UUID) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (*UUID) UnmarshalText

func (u *UUID) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Directories

Path Synopsis
internal
uuid
Package uuid generates and inspects UUIDs.
Package uuid generates and inspects UUIDs.

Jump to

Keyboard shortcuts

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