unique

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCUID

func CreateCUID() string

CreateCUID generates a 25 character cuid

func CreateGUID

func CreateGUID() string

CreateGUID generates and returns a uuid as a string

func CreateRawULID

func CreateRawULID() ulid.ULID

CreateRawULID create a raw ulid

func CreateSlug

func CreateSlug() string

CreateSlug generates a 9 or 10 character semi-unique

func CreateTSID

func CreateTSID() string

CreateTSID generates a 12 character time-stamp / base 36 id

func CreateTXID

func CreateTXID() string

CreateTXID generates a 16 character time-stamp / base 36 id

func CreateULID

func CreateULID() string

CreateULID generate and return a ulid as a string

func CreateUUID

func CreateUUID() string

CreateUUID generates and returns a uuid as a string

func CreateXUID

func CreateXUID() string

CreateXUID generates a 25 character cuid that starts with a random lowercase character

func RandomBytes

func RandomBytes(size int) ([]byte, error)

RandomBytes generates a byte buffer of the specified size and populates it with crypo-strength random bytes

func Version

func Version() string

Version - return the version number as a single string

Types

type Counter

type Counter interface {
	Next() int32
}

Counter interface default counter implementation

type DefaultCounter

type DefaultCounter struct {
	// contains filtered or unexported fields
}

DefaultCounter specific to cuid's

func (*DefaultCounter) Next

func (c *DefaultCounter) Next() int32

Next generate the next counter value

Jump to

Keyboard shortcuts

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