Documentation ¶
Index ¶
- func CantDecodeHex(err error, s string) error
- func CantParseFloat64(err error, s string) error
- func CantParseInt64(err error, s string) error
- func CantParseUint64(err error, s string) error
- func CantPerformQuery(err error, q string) error
- func CantUnmarshalYAML(err error, v interface{}) error
- func Checksum(data interface{}) []byte
- func FromUnixMilli(ms int64) time.Time
- func MarshalJSON(v interface{}) ([]byte, error)
- func MaxInt[T constraints.Integer](x, y T) T
- func Name(t interface{}) string
- func UnmarshalJSON(data []byte, v interface{}) error
- type Binary
- func (binary Binary) MarshalJSON() ([]byte, error)
- func (binary Binary) MarshalText() ([]byte, error)
- func (binary *Binary) Scan(src interface{}) error
- func (binary Binary) String() string
- func (binary *Binary) UnmarshalJSON(data []byte) error
- func (binary *Binary) UnmarshalText(text []byte) error
- func (binary Binary) Valid() bool
- func (binary Binary) Value() (driver.Value, error)
- type Bitmask
- type Bool
- type UnixMilli
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CantDecodeHex ¶
CantDecodeHex wraps the given error with the given string that cannot be hex-decoded.
func CantParseFloat64 ¶
CantParseFloat64 wraps the given error with the specified string that cannot be parsed into float64.
func CantParseInt64 ¶
CantParseInt64 wraps the given error with the specified string that cannot be parsed into int64.
func CantParseUint64 ¶
CantParseUint64 wraps the given error with the specified string that cannot be parsed into uint64.
func CantPerformQuery ¶
CantPerformQuery wraps the given error with the specified query that cannot be executed.
func CantUnmarshalYAML ¶
CantUnmarshalYAML wraps the given error with the designated value, which cannot be unmarshalled into.
func Checksum ¶
func Checksum(data interface{}) []byte
Checksum returns the SHA-1 checksum of the data.
func FromUnixMilli ¶
FromUnixMilli creates and returns a time.Time value from the given milliseconds since the Unix epoch ms.
func MarshalJSON ¶
MarshalJSON calls json.Marshal and wraps any resulting errors.
func MaxInt ¶
func MaxInt[T constraints.Integer](x, y T) T
func UnmarshalJSON ¶
UnmarshalJSON calls json.Unmarshal and wraps any resulting errors.
Types ¶
type Binary ¶
type Binary []byte
Binary nullable byte string. Hex as JSON.
func (Binary) MarshalJSON ¶
MarshalJSON implements a custom marshal function to encode the Binary as a hex string. MarshalJSON implements the json.Marshaler interface. Supports JSON null.
func (Binary) MarshalText ¶
MarshalText implements a custom marhsal function to encode the Binary as hex. MarshalText implements the encoding.TextMarshaler interface.
func (*Binary) UnmarshalJSON ¶
UnmarshalJSON implements a custom unmarshal function to decode a JSON hex string into a Binary. UnmarshalJSON implements the json.Unmarshaler interface. Supports JSON null.
func (*Binary) UnmarshalText ¶
UnmarshalText implements a custom unmarshal function to decode hex into a Binary. UnmarshalText implements the encoding.TextUnmarshaler interface.
type Bitmask ¶
type Bitmask[T constraints.Integer] struct { // contains filtered or unexported fields }
type Bool ¶
Bool represents a bool for ENUM ('y', 'n'), which can be NULL.
func (Bool) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Bool) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type UnixMilli ¶
UnixMilli is a nullable millisecond UNIX timestamp in databases and JSON.
func (UnixMilli) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. Marshals to milliseconds. Supports JSON null.
func (*UnixMilli) Scan ¶
Scan implements the sql.Scanner interface. Scans from milliseconds. Supports SQL NULL.
func (*UnixMilli) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Unmarshals from milliseconds. Supports JSON null.
func (*UnixMilli) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.