uuid

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package uuid generates and parses UUIDs. A simple API is exposed while the implemenation is provided by github.com/google/uuid

Index

Constants

This section is empty.

Variables

View Source
var Nil = UUID(uuid.Nil)

Nil represents an invalid or empty UUID.

Functions

This section is empty.

Types

type UUID

type UUID uuid.UUID

UUID is a 16 byte (128 bit) id, and can be used as a map key and in direct comparisons.

func Must

func Must(u UUID, err error) UUID

Must returns u or panics if err is not nil.

func New

func New() UUID

func Parse

func Parse(s string) (UUID, error)

Parse an UUID of the forms "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" and "urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".

func ParseBytes

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

Parse an UUID of the forms "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" and "urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" represented as a byte slice.

func (UUID) MarshalBinary

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

func (UUID) MarshalText

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

func (UUID) String

func (u UUID) String() string

String represents the UUID in the form "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".

func (*UUID) UnmarshalBinary

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

func (*UUID) UnmarshalText

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

Jump to

Keyboard shortcuts

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