Documentation ¶
Index ¶
- type ID
- func (d ID) Bytes() []byte
- func (d *ID) Clear()
- func (d ID) EqualsTo(x ID) bool
- func (d ID) MarshalText() ([]byte, error)
- func (d *ID) Scan(src interface{}) error
- func (d ID) String() string
- func (d ID) Time() time.Time
- func (d *ID) UnmarshalText(text []byte) error
- func (d ID) Value() (driver.Value, error)
- func (d ID) Zero() bool
- type NullID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID [12]byte
ID is an array of 12 bytes that is supposed to be composed of 8 bytes of time (number of nanoseconds elapsed since January 1, 1970 UTC) and 4 random bytes.
func FromString ¶
FromString unmarshals hex into id.
hex can be any valid hexadecimal number corresponding to len(id) bytes.
func (ID) MarshalText ¶
MarshalText implements encoding.TextMarshaler interface. And returns the hexadecimal encoding of ID.
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler interface. text is supposed to be the hexadecimal encoding of an ID.
type NullID ¶
NullID represents an ID that may be null.
func (NullID) MarshalJSON ¶
MarshalJSON implements json.Marshalar interface.
func (*NullID) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshalar interface.
Click to show internal directories.
Click to hide internal directories.