Documentation ¶
Overview ¶
Package sandid implements a unique ID generation algorithm to ensure that every grain of sand on Earth has its own ID.
Index ¶
- func Compare(a, b SandID) int
- func Equal(a, b SandID) bool
- type NullSandID
- type SandID
- func (sID SandID) IsZero() bool
- func (sID SandID) MarshalBinary() ([]byte, error)
- func (sID SandID) MarshalJSON() ([]byte, error)
- func (sID SandID) MarshalText() ([]byte, error)
- func (sID *SandID) Scan(value interface{}) error
- func (sID SandID) String() string
- func (sID *SandID) UnmarshalBinary(data []byte) error
- func (sID *SandID) UnmarshalJSON(data []byte) error
- func (sID *SandID) UnmarshalText(text []byte) error
- func (sID SandID) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NullSandID ¶
NullSandID represents an instance of the SandID that may be null. It implements the database/sql.Scanner so it can be used as a scan destination.
func (*NullSandID) Scan ¶
func (nsID *NullSandID) Scan(value interface{}) error
Scan implements the database/sql.Scanner.
func (NullSandID) Value ¶
func (nsID NullSandID) Value() (driver.Value, error)
Value implements the driver.Valuer.
type SandID ¶
type SandID [16]byte
SandID is an ID of sand.
func (SandID) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler.
func (SandID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler.
func (SandID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler.
func (*SandID) Scan ¶
Scan implements the database/sql.Scanner.
The value must be a string or []byte.
func (*SandID) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler.
func (*SandID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler.
func (*SandID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler.