Documentation
¶
Index ¶
- type Money
- func (m Money) MarshalJSON() (text []byte, err error)
- func (m Money) MarshalText() (text []byte, err error)
- func (m Money) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)
- func (m Money) Text() string
- func (m *Money) UnmarshalJSON(data []byte) (err error)
- func (m *Money) UnmarshalText(text []byte) (err error)
- func (m *Money) UnmarshalTextString(text string) (err error)
- func (m *Money) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- type Money2
- func (m Money2) MarshalJSON() ([]byte, error)
- func (m Money2) MarshalText() (text []byte, err error)
- func (m Money2) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)
- func (m *Money2) Scan(value interface{}) error
- func (m Money2) Text() string
- func (m *Money2) UnmarshalJSON(data []byte) (err error)
- func (m *Money2) UnmarshalText(text []byte) (err error)
- func (m *Money2) UnmarshalTextString(text string) (err error)
- func (m *Money2) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- func (m Money2) Value() (driver.Value, error)
- type NullMoney
- type NullMoney2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Money ¶
type Money int64
Money 表示金钱, 单位为分.
func (Money) MarshalJSON ¶
MarshalJSON 将 Money 编码成 "xxxx.yz" 这样以 '元' 为单位的字符串.
func (Money) MarshalText ¶
MarshalText 将 Money 编码成 xxxx.yz 这样以 '元' 为单位的字符串.
func (Money) MarshalXML ¶
MarshalXML 将 Money 编码成 xxxx.yz 这样以 '元' 为单位的字符串.
func (*Money) UnmarshalJSON ¶
UnmarshalJSON 将 "xxxx.yz" 这样以 '元' 为单位的字符串解码到 Money 中.
func (*Money) UnmarshalText ¶
UnmarshalText 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money 中.
func (*Money) UnmarshalTextString ¶
UnmarshalTextString 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money 中.
func (*Money) UnmarshalXML ¶
UnmarshalXML 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money 中.
type Money2 ¶
type Money2 int64
Money2 表示金钱, 单位为分.
Money2 是 Money 的扩展, 支持数据库 decimal(x.2) 类型的直接存取.
func (Money2) MarshalJSON ¶
MarshalJSON 将 Money2 编码成 "xxxx.yz" 这样以 '元' 为单位的字符串.
func (Money2) MarshalText ¶
MarshalText 将 Money2 编码成 xxxx.yz 这样以 '元' 为单位的字符串.
func (Money2) MarshalXML ¶
MarshalXML 将 Money2 编码成 xxxx.yz 这样以 '元' 为单位的字符串.
func (*Money2) UnmarshalJSON ¶
UnmarshalJSON 将 "xxxx.yz" 这样以 '元' 为单位的字符串解码到 Money2 中.
func (*Money2) UnmarshalText ¶
UnmarshalText 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money2 中.
func (*Money2) UnmarshalTextString ¶
UnmarshalTextString 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money2 中.
func (*Money2) UnmarshalXML ¶
UnmarshalXML 将 xxxx.yz 这样以 '元' 为单位的字符串解码到 Money2 中.
type NullMoney ¶
NullMoney represents an Money that may be null. NullMoney implements the Scanner interface so it can be used as a scan destination, similar to NullString.
type NullMoney2 ¶
NullMoney2 represents an Money2 that may be null. NullMoney2 implements the Scanner interface so it can be used as a scan destination, similar to NullString.
func (*NullMoney2) Scan ¶
func (m *NullMoney2) Scan(value interface{}) error
Scan implements the sql.Scanner interface.