util

package
v0.0.0-...-95ed4ff Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID []byte

UUID represents a unique identifier conforming to the RFC 4122 standard. UUIDs are a fixed 128bit (16 byte) binary blob.

func Parse

func Parse(corpus string) (UUID, error)

Parse parses a uuidv4 from a given string. valid forms are: - {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

func V4

func V4() UUID

V4 Create a new UUID version 4.

func (UUID) Format

func (uuid UUID) Format(s fmt.State, verb rune)

Format allows for conditional expansion in printf statements based on the token and flags used.

func (UUID) IsV4

func (uuid UUID) IsV4() bool

IsV4 returns true iff uuid has version number 4, variant number 2, and length 16 bytes

func (UUID) String

func (uuid UUID) String() string

String is an alias for `ToShortString`.

func (UUID) ToFullString

func (uuid UUID) ToFullString() string

ToFullString returns a "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" hex representation of a uuid.

func (UUID) ToShortString

func (uuid UUID) ToShortString() string

ToShortString returns a hex representation of the uuid.

func (UUID) Version

func (uuid UUID) Version() byte

Version returns the version byte of a uuid.

Jump to

Keyboard shortcuts

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