guid

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("guid: invalid format")

ErrInvalid is returned when parsing a string that is not formatted as a valid guid.

Functions

func IsGuid

func IsGuid(s string) bool

IsGuid returns true if the string contains a properly formatted Guid.

func NewString

func NewString() string

NewString is a helper function that returns a random RFC 4122-comformant version 4 Guid as a string.

Types

type Guid

type Guid [16]byte

Guid is a globally unique 16 byte identifier

func New

func New() *Guid

New generates a random RFC 4122-conformant version 4 Guid.

func ParseString

func ParseString(s string) (*Guid, error)

ParseString returns the Guid represented by the string s.

func (*Guid) IsConformant

func (g *Guid) IsConformant() bool

IsConformant determines if the Guid is RFC 4122-conformant. If the variant is "reserved for future definition" or the version is unknown, then it is non-conformant.

func (*Guid) String

func (g *Guid) String() string

String returns a standard hexadecimal string version of the Guid. Lowercase characters are used.

func (*Guid) StringUpper

func (g *Guid) StringUpper() string

StringUpper returns a standard hexadecimal string version of the Guid. Uppercase characters are used.

Jump to

Keyboard shortcuts

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