ulids

package
v0.0.0-...-11620cc Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ulids provides support for generating and parsing ULIDs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsZero

func IsZero(id ulid.ULID) bool

IsZero returns true if the id is a zero value

func MonotonicULIDGenerator

func MonotonicULIDGenerator() func() ulid.ULID

MonotonicULIDGenerator returns a function that generates ULID(s) in strictly increasing order.

  • is safe for concurrent use.
  • panics if a ULID fails to be generated

func MustNew

func MustNew() ulid.ULID

MustNew generates a new crypto/rand based ULID.

  • panics if a ULID fails to be generated

func Parse

func Parse(id string) (ulid.ULID, error)

Parse tries to parse the id into a ULID.

func RandomULIDGenerator

func RandomULIDGenerator() func() ulid.ULID

RandomULIDGenerator returns a function that generates a cryptographically random ULID

  • this is ~5x slower than MonotonicULIDGenerator functions
  • panics if a ULID fails to be generated

Types

This section is empty.

Jump to

Keyboard shortcuts

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