id

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(s string) bool

func NewString

func NewString() (string, error)

func NewStringFromTime

func NewStringFromTime(time time.Time) (string, error)

Types

type ID

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

func Must added in v0.2.3

func Must(id *ID, err error) *ID

Must is a convenience function that is useful for tests and when starting up.

func New added in v0.2.3

func New() (*ID, error)

func NewFromTime

func NewFromTime(time time.Time) (*ID, error)

NewFromTime returns a new *ID based on the given time.Time. TODO: since ulid.DefaultEntropy() can't fail it may be worth refactoring this to remove the error.

func Parse

func Parse(s string) (*ID, error)

func (*ID) String added in v0.2.3

func (id *ID) String() string

func (*ID) Time

func (id *ID) Time() time.Time

Jump to

Keyboard shortcuts

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