uuid

package
v0.0.0-...-53c686c Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package uuid can be used to generate 128 bit UUIDs compatible with rfc4122. Currently, only version 4 UUIDs, UUIDs generated from random data, can be created. The package includes functions for generating UUIDs and for converting them to and from strings.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUUIDInvalid indicates that a UIID is invalid.  Currently,
	// returned by uuid.Parse if the string passed to this function
	// does not contain a valid UUID.
	ErrUUIDInvalid = errors.New("invalid uuid")
)

Functions

This section is empty.

Types

type UUID

type UUID [16]byte

UUID represents a single 128 bit UUID as an array of 16 bytes.

func Generate

func Generate() UUID

Generate generates a new v4 UUID, i.e., a random UUID.

func Parse

func Parse(s string) (UUID, error)

Parse returns the binary encoding of the UUID passed in the s parameter. The error ErrUUIDInvalid will be returned if s does not represent a valid UUID.

func (UUID) String

func (u UUID) String() string

Jump to

Keyboard shortcuts

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