uuid

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uuid provides simple UUID generation. Only version 4 style UUIDs can be generated.

Please see http://tools.ietf.org/html/rfc4122 for details on UUIDs.

Index

Constants

View Source
const (
	// Bits is the number of bits in a UUID
	Bits = 128

	// Size is the number of bytes in a UUID
	Size = Bits / 8
)

Variables

View Source
var (
	// ErrUUIDInvalid indicates a parsed string is not a valid uuid.
	ErrUUIDInvalid = fmt.Errorf("invalid uuid")

	// Loggerf can be used to override the default logging destination. Such
	// log messages in this library should be logged at warning or higher.
	Loggerf = func(format string, args ...interface{}) {}
)

Functions

This section is empty.

Types

type UUID

type UUID [Size]byte

UUID represents a UUID value. UUIDs can be compared and set to other values and accessed by byte.

func Generate

func Generate() (u UUID)

Generate creates a new, version 4 uuid.

func Parse

func Parse(s string) (u UUID, err error)

Parse attempts to extract a uuid from the string or returns an error.

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