ulid

package
v0.0.0-...-22e1697 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Size       = 16
	StringSize = 26
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ULID

type ULID [Size]byte

TODO

var (
	Nil ULID
)

func New

func New() ULID

func NewErr

func NewErr() (ULID, error)

func Parse

func Parse(input string) (ret ULID, err error)

func ParseBytes

func ParseBytes(input []byte) (ret ULID, err error)

func (ULID) Bytes

func (ulid ULID) Bytes() []byte

func (ULID) Equal

func (ulid ULID) Equal(other ULID) bool

func (ULID) MarshalBinary

func (ulid ULID) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (ULID) MarshalText

func (ulid ULID) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ULID) Scan

func (ulid *ULID) Scan(src interface{}) (err error)

TODO: improve Scan implements sql.Scanner so ULIDs can be read from databases transparently. Currently, database types that map to string and []byte are supported. Please consult database-specific driver documentation for matching types.

func (ULID) String

func (ulid ULID) String() string

String returns the string form of ulid

func (ULID) UUIDString

func (ulid ULID) UUIDString() string

UUIDString returns the UUID string form of ulid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

func (*ULID) UnmarshalText

func (ulid *ULID) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ULID) Value

func (ulid ULID) Value() (driver.Value, error)

Value implements sql.Valuer so that ULIDs can be written to databases transparently. Currently, ULIDs map to strings. Please consult database-specific driver documentation for matching types.

Jump to

Keyboard shortcuts

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