Documentation ¶
Index ¶
- Constants
- type AcknowledgementState
- type Binary
- func (binary Binary) Equal(equaler contracts.Equaler) bool
- 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 Bool
- type CommentType
- type Float
- type Int
- type NotificationStates
- type NotificationType
- type NotificationTypes
- type StateType
- type String
- type UUID
- type UnixMilli
Constants ¶
const ( StateSoft = StateType(0) StateHard = StateType(1) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgementState ¶
type AcknowledgementState uint8
AcknowledgementState specifies an acknowledgement state (yes, no, sticky).
func (*AcknowledgementState) UnmarshalJSON ¶
func (as *AcknowledgementState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*AcknowledgementState) UnmarshalText ¶
func (as *AcknowledgementState) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Binary ¶
type Binary []byte
Binary nullable byte string. Hex as JSON.
func (Binary) Equal ¶
Equal returns whether the binaries are the same length and contain the same bytes.
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 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 CommentType ¶
type CommentType uint8
CommentType specifies a comment's origin's kind.
func (*CommentType) UnmarshalJSON ¶
func (ct *CommentType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*CommentType) UnmarshalText ¶
func (ct *CommentType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Float ¶
type Float struct {
sql.NullFloat64
}
Float adds JSON support to sql.NullFloat64.
func (Float) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. Supports JSON null.
func (*Float) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Supports JSON null.
func (*Float) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Int ¶
Int adds JSON support to sql.NullInt64.
func (Int) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. Supports JSON null.
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Supports JSON null.
func (*Int) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NotificationStates ¶
type NotificationStates uint8
NotificationStates specifies the set of states a notification may be sent for.
func (*NotificationStates) UnmarshalJSON ¶
func (nst *NotificationStates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*NotificationStates) UnmarshalText ¶
func (nst *NotificationStates) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NotificationType ¶
type NotificationType uint16
NotificationType specifies the reason of a sent notification.
func (*NotificationType) UnmarshalText ¶
func (nt *NotificationType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NotificationTypes ¶
type NotificationTypes uint16
NotificationTypes specifies the set of reasons a notification may be sent for.
func (*NotificationTypes) UnmarshalJSON ¶
func (nt *NotificationTypes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*NotificationTypes) UnmarshalText ¶
func (nt *NotificationTypes) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type StateType ¶
type StateType uint8
StateType specifies a state's hardness.
func (*StateType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*StateType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type String ¶
type String struct {
sql.NullString
}
String adds JSON support to sql.NullString.
func MakeString ¶ added in v1.2.0
MakeString constructs a new non-NULL String from s.
func (String) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. Supports JSON null.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Supports JSON null.
func (*String) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type UUID ¶
UUID is like uuid.UUID, but marshals itself binarily (not like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) in SQL context.
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.