Documentation ¶
Overview ¶
Package types contain misc data structures.
Index ¶
- type Bytes16
- func (b Bytes16) Compare(other Bytes16) int
- func (b Bytes16) Equal(other Bytes16) bool
- func (b *Bytes16) FromHexString(buf []byte) error
- func (b Bytes16) Marshal() ([]byte, error)
- func (b Bytes16) MarshalJSON() ([]byte, error)
- func (b Bytes16) MarshalTo(buf []byte) (n int, err error)
- func (b *Bytes16) Scan(src any) error
- func (b *Bytes16) Size() int
- func (b Bytes16) ToHexString() string
- func (b *Bytes16) Unmarshal(buf []byte) error
- func (b *Bytes16) UnmarshalJSON(from []byte) error
- func (b Bytes16) Value() (driver.Value, error)
- type Decimal
- type JSON
- type JSONTime
- type NullDecimal
- type UUID
- func (u *UUID) Clear() *UUID
- func (u UUID) Compare(other UUID) int
- func (u UUID) Equal(other UUID) bool
- func (u UUID) IsZero() bool
- func (u UUID) Marshal() ([]byte, error)
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) MarshalTo(buf []byte) (n int, err error)
- func (u *UUID) Random() *UUID
- func (u *UUID) Scan(src any) error
- func (u *UUID) Size() int
- func (u UUID) ToHexString() string
- func (u *UUID) UUIDFromHexString(buf []byte) error
- func (u *UUID) Unmarshal(buf []byte) error
- func (u *UUID) UnmarshalJSON(from []byte) error
- func (u UUID) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes16 ¶
type Bytes16 [16]byte
Bytes16 is an alias for [16]byte, Bytes16 implements Marshal and Unmarshal.
func ParseBytes16 ¶
ParseBytes is like Parse, except it parses a byte slice instead of a string.
func (*Bytes16) FromHexString ¶
func (Bytes16) MarshalJSON ¶
func (Bytes16) ToHexString ¶
func (*Bytes16) UnmarshalJSON ¶
type Decimal ¶
Decimal is a DECIMAL in sql. Its zero value is valid for use with both Value and Scan.
Although decimal can represent NaN and Infinity it will return an error if an attempt to store these values in the database is made.
Because it cannot be nil, when Big is nil Value() will return "0" It will error if an attempt to Scan() a "null" value into it.
func NewDecimal ¶
NewDecimal creates a new decimal from a decimal
type JSON ¶
type JSON json.RawMessage
JSON is an alias for json.RawMessage, which is a []byte underneath. JSON implements Marshal and Unmarshal.
func (JSON) MarshalJSON ¶
MarshalJSON returns j as the JSON encoding of j.
func (*JSON) UnmarshalJSON ¶
UnmarshalJSON sets *j to a copy of data.
type NullDecimal ¶
NullDecimal is the same as Decimal, but allows the Big pointer to be nil. See docmentation for Decimal for more details.
When going into a database, if Big is nil it's value will be "null".
func NewNullDecimal ¶
func NewNullDecimal(d *decimal.Big) NullDecimal
NewNullDecimal creates a new null decimal from a decimal
type UUID ¶
type UUID [16]byte