TTuuid

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLength = 36

DefaultLength is the standard UUID length.

Variables

This section is empty.

Functions

func Random

func Random() goUuid.UUID

Random returns a standard random based UUIDv4 object.

func Time

func Time() goUuid.UUID

Time returns a standard time based UUIDv1 object.

Types

type ErrTooManyHyphens

type ErrTooManyHyphens int

ErrTooManyHyphens satisfies error interface.

func (ErrTooManyHyphens) Error

func (e ErrTooManyHyphens) Error() string

type TTuuid

type TTuuid struct {
	Hyphens int
	Length  int
}

TTuuid holds info for both Hyphens and Length

func New

func New(hyphens, length int) (*TTuuid, error)

New returns a new TTuuid object for given number of hyphens and length of resultant uuid string.

length == 0, will use default: 36

func (*TTuuid) Custom

func (ttuuid *TTuuid) Custom() string

Custom returns a mixed UUIDv1 + UUIDv4 string with custom number of hyphens and specified overall length.

Jump to

Keyboard shortcuts

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