Documentation ¶
Index ¶
- type BOOL
- type ByteArray
- type DATE
- func (t DATE) MarshalJSON() ([]byte, error)
- func (t DATE) MarshalText() ([]byte, error)
- func (t *DATE) Scan(value interface{}) error
- func (t *DATE) SetLayout(layout string) *DATE
- func (t *DATE) SetNULL()
- func (t *DATE) SetVal(szDate string) error
- func (t DATE) String() string
- func (t DATE) ToTime() time.Time
- func (t *DATE) UnmarshalJSON(data []byte) error
- func (t DATE) Value() (driver.Value, error)
- type DATETIME
- func (t DATETIME) MarshalJSON() ([]byte, error)
- func (t DATETIME) MarshalText() ([]byte, error)
- func (t *DATETIME) Scan(value interface{}) error
- func (t *DATETIME) SetLayout(layout string) *DATETIME
- func (t *DATETIME) SetNULL() *DATETIME
- func (t *DATETIME) SetTimezone(tz *time.Location) *DATETIME
- func (t *DATETIME) SetVal(tm time.Time) *DATETIME
- func (t DATETIME) String() string
- func (t DATETIME) ToTime() time.Time
- func (t *DATETIME) UnmarshalJSON(data []byte) error
- func (t DATETIME) Value() (driver.Value, error)
- type DATETIME_LOCAL
- func (t DATETIME_LOCAL) MarshalJSON() ([]byte, error)
- func (t DATETIME_LOCAL) MarshalText() ([]byte, error)
- func (t *DATETIME_LOCAL) Scan(value interface{}) error
- func (t *DATETIME_LOCAL) SetLayout(layout string)
- func (t *DATETIME_LOCAL) SetNULL() *DATETIME_LOCAL
- func (t *DATETIME_LOCAL) SetVal(tm time.Time) *DATETIME_LOCAL
- func (t DATETIME_LOCAL) String() string
- func (t DATETIME_LOCAL) ToTime() time.Time
- func (t *DATETIME_LOCAL) UnmarshalJSON(data []byte) error
- func (t DATETIME_LOCAL) Value() (driver.Value, error)
- type FLOAT64
- type Float64Array
- type INT64
- type Int64Array
- type JSONB
- func (t JSONB) MarshalJSON() ([]byte, error)
- func (t JSONB) MarshalText() ([]byte, error)
- func (t *JSONB) Merge(mp map[string]interface{}) *JSONB
- func (t *JSONB) Scan(value interface{}) error
- func (t *JSONB) SetNULL()
- func (t *JSONB) SetVal(mp map[string]interface{}) error
- func (t JSONB) String() string
- func (t *JSONB) UnmarshalJSON(data []byte) error
- func (t JSONB) Value() (driver.Value, error)
- type STRING
- type StringArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BOOL ¶
------------------------------------------------------------------------------ 空字段会解析为 false
func (BOOL) MarshalJSON ¶
func (*BOOL) UnmarshalJSON ¶
type ByteArray ¶
type ByteArray = pq.ByteaArray
type DATE ¶
type DATE struct { Valid bool // contains filtered or unexported fields }
注意:日期不带时区信息
func (DATE) MarshalJSON ¶
func (DATE) MarshalText ¶
func (*DATE) UnmarshalJSON ¶
type DATETIME ¶
type DATETIME struct { Valid bool // contains filtered or unexported fields }
func NewDateTime ¶
layout默认为: "2006-01-02 15:04:05", 时区为tm所在时区
func NewDateTimeLocal ¶
szDate为本地时区时间。 layout格式为: "2006-01-02 15:04:05"
func NewDateTimeUTC ¶
szDate 为UTC时间。 layout格式为: "2006-01-02 15:04:05"
func (DATETIME) MarshalJSON ¶
func (DATETIME) MarshalText ¶
func (*DATETIME) SetTimezone ¶
设置时区 影响MarshalJSON(), MarshalText(), String(), UnmarshalJSON() 显示
func (*DATETIME) UnmarshalJSON ¶
type DATETIME_LOCAL ¶
type DATETIME_LOCAL struct { Valid bool // contains filtered or unexported fields }
func (DATETIME_LOCAL) MarshalJSON ¶
func (t DATETIME_LOCAL) MarshalJSON() ([]byte, error)
func (DATETIME_LOCAL) MarshalText ¶
func (t DATETIME_LOCAL) MarshalText() ([]byte, error)
func (*DATETIME_LOCAL) Scan ¶
func (t *DATETIME_LOCAL) Scan(value interface{}) error
Scan implements the sql.Scanner interface. read data from database
func (*DATETIME_LOCAL) SetLayout ¶
func (t *DATETIME_LOCAL) SetLayout(layout string)
时间字符串解析/显示 layout
func (*DATETIME_LOCAL) SetNULL ¶
func (t *DATETIME_LOCAL) SetNULL() *DATETIME_LOCAL
func (*DATETIME_LOCAL) SetVal ¶
func (t *DATETIME_LOCAL) SetVal(tm time.Time) *DATETIME_LOCAL
func (DATETIME_LOCAL) String ¶
func (t DATETIME_LOCAL) String() string
func (DATETIME_LOCAL) ToTime ¶
func (t DATETIME_LOCAL) ToTime() time.Time
func (*DATETIME_LOCAL) UnmarshalJSON ¶
func (t *DATETIME_LOCAL) UnmarshalJSON(data []byte) error
type FLOAT64 ¶
type FLOAT64 struct {
sql.NullFloat64
}
------------------------------------------------------------------------------ 空字段会解析为0
func (FLOAT64) MarshalJSON ¶
func (*FLOAT64) UnmarshalJSON ¶
type Float64Array ¶
type Float64Array = pq.Float64Array
type INT64 ¶
------------------------------------------------------------------------------ 空字段会解析为0
func (INT64) MarshalJSON ¶
func (*INT64) UnmarshalJSON ¶
type Int64Array ¶
type Int64Array = pq.Int64Array
type JSONB ¶
type JSONB struct {
KV map[string]interface{}
}
------------------------------------------------------------------------------ JSONB格式,数据库字段格式为: "{}", 不能为json数组等其他格式 空字段解析为空map
func (JSONB) MarshalJSON ¶
func (JSONB) MarshalText ¶
func (*JSONB) UnmarshalJSON ¶
type STRING ¶
type STRING struct {
sql.NullString
}
------------------------------------------------------------------------------ 空字段解析为空字符串
func (STRING) MarshalJSON ¶
func (*STRING) UnmarshalJSON ¶
type StringArray ¶
type StringArray = pq.StringArray