Documentation
¶
Index ¶
- Constants
- Variables
- type MonotonicEntropy
- type MonotonicReader
- type MonotonicReaderBig
- type NULID
- func FromNanos(timestampNanos uint64, random uint64) NULID
- func FromNanosBig(timestampNanos *big.Int, random uint64) (NULID, error)
- func FromTime(t time.Time, random uint64) (NULID, error)
- func Make() (id NULID)
- func MustParse(ulid string) NULID
- func New() (NULID, error)
- func NewWithEntropy(timestampNanos uint64, r io.Reader) (NULID, error)
- func NewWithEntropyBig(timestampNanos *big.Int, r io.Reader) (NULID, error)
- func NewWithTime(t time.Time, r io.Reader) (NULID, error)
- func Parse(id string) (NULID, error)
- func (id NULID) Bytes() [16]byte
- func (id NULID) Compare(other NULID) int
- func (id NULID) IsNil() bool
- func (id NULID) Less(other NULID) bool
- func (id NULID) MarshalBinary() ([]byte, error)
- func (id NULID) MarshalText() ([]byte, error)
- func (id NULID) Random() uint64
- func (id *NULID) Scan(src any) error
- func (id NULID) String() string
- func (id NULID) Time() time.Time
- func (id *NULID) UnmarshalBinary(data []byte) error
- func (id *NULID) UnmarshalText(text []byte) error
- func (id NULID) Value() (driver.Value, error)
Constants ¶
View Source
const EntropyLen = 8
Variables ¶
View Source
var ( ErrMonotonicOverflow = errors.New("nulid: monotonic entropy overflow") )
View Source
var (
ErrScanValue = errors.New("nulid: unsupported value type for Scan")
)
Functions ¶
This section is empty.
Types ¶
type MonotonicEntropy ¶
func (*MonotonicEntropy) MonotonicRead ¶
func (m *MonotonicEntropy) MonotonicRead(timestampNanos uint64, p []byte) error
func (*MonotonicEntropy) MonotonicReadBig ¶
func (m *MonotonicEntropy) MonotonicReadBig(timestampNanos *big.Int, p []byte) error
type MonotonicReader ¶
type MonotonicReaderBig ¶
type MonotonicReaderBig interface {
MonotonicReader
MonotonicReadBig(timestampNanos *big.Int, p []byte) error
}
type NULID ¶
type NULID [16]byte
func NewWithEntropyBig ¶
func (NULID) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler
func (NULID) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*NULID) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
func (*NULID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.