Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateTime ¶
func NewDateTime ¶
func (*DateTime) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Duration ¶
Duration represents a mysql TIME column
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
type NullBool ¶
NullBool represents a nullable bool type which supports json Marshaler, sql Scanner, and sql driver Valuer interfaces.
func NewNullBool ¶
NewNullBool returns a valid new NullBool for a given boolean value.
func (NullBool) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for a NullBool.
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for a NullBool.
type NullDuration ¶
NullDuration represents a nullable string type which supports json Marshaler, sql Scanner, and sql driver Valuer interfaces.
func NewNullDuration ¶
func NewNullDuration(t time.Duration) *NullDuration
NewNullDuration returns a valid new NullDuration for a given time.Duration value.
func (NullDuration) MarshalJSON ¶
func (r NullDuration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for a NullDuration.
func (*NullDuration) UnmarshalJSON ¶
func (r *NullDuration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for a NullDuration.
type NullEnum ¶
type NullEnum NullString
NullEnum represents nullable enum values in sql
func NewNullEnum ¶
NewNullEnum return a valid new NullEnum for a given value
type NullFloat64 ¶
type NullFloat64 struct {
sql.NullFloat64
}
NullFloat64 represents a nullable float64 type which supports json Marshaler, sql Scanner, and sql driver Valuer interfaces.
func NewNullFloat64 ¶
func NewNullFloat64(f float64) *NullFloat64
NewNullFloat64 returns a valid new NullFloat64 for a given float64 value.
func (NullFloat64) MarshalJSON ¶
func (r NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for a NullFloat64.
func (*NullFloat64) UnmarshalJSON ¶
func (r *NullFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for a NullFloat64.
type NullInt64 ¶
NullInt64 represents a nullable int64 type which supports json Marshaler, sql Scanner, and sql driver Valuer interfaces.
func NewNullInt64 ¶
NewNullInt64 returns a valid new NullInt64 for a given int64 value.
func (NullInt64) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for a NullInt64.
func (NullInt64) RedisArg ¶
func (r NullInt64) RedisArg() interface{}
RedisArg implements redis.Argument.
The caller should explicitly check the Valid field when putting NullString values into Redis. If this is not done it can lead to confusion as RedisScan on this type will treat an empty non-nil string as valid.
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for a NullInt64.
type NullString ¶
type NullString struct {
sql.NullString
}
NullString represents a nullable string type which supports json Marshaler, sql Scanner, and sql driver Valuer interfaces.
func NewNullString ¶
func NewNullString(s string) *NullString
NewNullString returns a valid new NullString for a given string value.
func (NullString) MarshalJSON ¶
func (r NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for a NullString.
func (NullString) RedisArg ¶
func (r NullString) RedisArg() interface{}
RedisArg implements redis.Argument.
The caller should explicitly check the Valid field when putting NullString values into Redis. If this is not done it can lead to confusion as RedisScan on this type will treat an empty non-nil string as valid.
func (*NullString) RedisScan ¶
func (r *NullString) RedisScan(src interface{}) error
RedisScan implements redis.Scanner.
func (*NullString) UnmarshalJSON ¶
func (r *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for a NullString.
type NullTime ¶
NullTime represents a nullable string type which supports json.Marshaler, sql.Scanner, and sql/driver.Valuer interfaces.
func NewNullTime ¶
NewNullTime returns a valid new NullTime for a given time.Time value.
func (NullTime) MarshalJSON ¶
MarshalJSON implements json.Marshaller.
func (NullTime) RedisArg ¶
func (r NullTime) RedisArg() interface{}
RedisArg implements redis.Argument.
The time will be serialized as a UTC unix timestamp.
func (*NullTime) RedisScan ¶
RedisScan implements redis.Scanner.
The src value is expected to be a UTC timestamp formatted as a unix timestamp.
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for a NullTime.