Documentation ¶
Index ¶
- type IPAddr
- type NullBool
- type NullFloat32
- func (dst *NullFloat32) FromString(src string) error
- func (src NullFloat32) MarshalJSON() ([]byte, error)
- func (dst *NullFloat32) Scan(src interface{}) error
- func (ns *NullFloat32) SetValue(val float32)
- func (dst *NullFloat32) UnmarshalJSON(b []byte) error
- func (src NullFloat32) Value() (driver.Value, error)
- type NullFloat64
- func (dst *NullFloat64) FromString(src string) error
- func (src NullFloat64) MarshalJSON() ([]byte, error)
- func (dst *NullFloat64) Scan(src interface{}) error
- func (ns *NullFloat64) SetValue(val float64)
- func (dst *NullFloat64) UnmarshalJSON(b []byte) error
- func (src NullFloat64) Value() (driver.Value, error)
- type NullInt16
- type NullInt32
- type NullInt64
- type NullString
- type NullTime
- type OnlyTime
- type UnixTime
- func (nt *UnixTime) Format(layout string) string
- func (nt UnixTime) MarshalJSON() ([]byte, error)
- func (nt *UnixTime) Scan(value interface{}) error
- func (nt *UnixTime) String() string
- func (nt *UnixTime) Time() time.Time
- func (nt *UnixTime) UnmarshalJSON(b []byte) (err error)
- func (nt UnixTime) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPAddr ¶
func (IPAddr) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*IPAddr) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type NullBool ¶
type NullBool bool
func (*NullBool) FromString ¶
func (NullBool) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type NullFloat32 ¶
func NewNullFloat32 ¶ added in v0.0.7
func NewNullFloat32(val float32) NullFloat32
func (*NullFloat32) FromString ¶
func (dst *NullFloat32) FromString(src string) error
func (NullFloat32) MarshalJSON ¶
func (src NullFloat32) MarshalJSON() ([]byte, error)
MarshalJSON convert field value to JSON
func (*NullFloat32) Scan ¶
func (dst *NullFloat32) Scan(src interface{}) error
Scan implements the database/sql Scanner interface.
func (*NullFloat32) SetValue ¶ added in v0.0.4
func (ns *NullFloat32) SetValue(val float32)
func (*NullFloat32) UnmarshalJSON ¶
func (dst *NullFloat32) UnmarshalJSON(b []byte) error
UnmarshalJSON parse JSON valus and set into field
type NullFloat64 ¶
func NewNullFloat64 ¶ added in v0.0.7
func NewNullFloat64(val float64) NullFloat64
func (*NullFloat64) FromString ¶
func (dst *NullFloat64) FromString(src string) error
func (NullFloat64) MarshalJSON ¶
func (src NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON convert field value to JSON
func (*NullFloat64) Scan ¶
func (dst *NullFloat64) Scan(src interface{}) error
Scan implements the database/sql Scanner interface.
func (*NullFloat64) SetValue ¶ added in v0.0.4
func (ns *NullFloat64) SetValue(val float64)
func (*NullFloat64) UnmarshalJSON ¶
func (dst *NullFloat64) UnmarshalJSON(b []byte) error
UnmarshalJSON parse JSON valus and set into field
type NullInt16 ¶
func NewNullInt16 ¶ added in v0.0.7
func (*NullInt16) FromString ¶
func (NullInt16) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*NullInt16) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type NullInt32 ¶
func NewNullInt32 ¶ added in v0.0.7
func (*NullInt32) FromString ¶
func (NullInt32) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*NullInt32) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type NullInt64 ¶
func NewNullInt64 ¶ added in v0.0.7
func (*NullInt64) FromString ¶
func (NullInt64) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type NullString ¶
NullString to scan nil string values from database
func NewNullString ¶ added in v0.0.7
func NewNullString(val string) NullString
func (NullString) MarshalJSON ¶
func (ns NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this String is null.
func (*NullString) Scan ¶
func (ns *NullString) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*NullString) SetValue ¶ added in v0.0.4
func (ns *NullString) SetValue(val string)
func (*NullString) UnmarshalJSON ¶
func (ns *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler. It supports string and null input. Blank string input does not produce a null String. It also supports unmarshalling a sql.NullString.
type NullTime ¶
NullTime
func NewNullTime ¶ added in v0.0.7
func (NullTime) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type OnlyTime ¶
OnlyTime represents only time portion of datetime
func (OnlyTime) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*OnlyTime) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
type UnixTime ¶
UnixTime to scan time values from database to unix timestamp
func NewUnixTime ¶
NewUnixTime create new UnixTime struct for given time.Time
func (UnixTime) MarshalJSON ¶
MarshalJSON convert field value to JSON
func (*UnixTime) UnmarshalJSON ¶
UnmarshalJSON parse JSON valus and set into field
It is setter, so *UnixTime is required