Documentation
¶
Overview ¶
Package types 提供部分存取数据库的类型
Index ¶
- type Decimal
- func (n Decimal) MarshalJSON() ([]byte, error)
- func (n Decimal) MarshalText() ([]byte, error)
- func (n *Decimal) ParseDefault(v string) error
- func (n Decimal) PrimitiveType() core.PrimitiveType
- func (n *Decimal) Scan(src interface{}) (err error)
- func (n *Decimal) UnmarshalJSON(data []byte) error
- func (n *Decimal) UnmarshalText(data []byte) error
- func (n Decimal) Value() (driver.Value, error)
- type Rat
- func (n Rat) IsNull() bool
- func (n Rat) MarshalText() ([]byte, error)
- func (n *Rat) ParseDefault(v string) error
- func (n Rat) PrimitiveType() core.PrimitiveType
- func (n Rat) Rat() *big.Rat
- func (n *Rat) Scan(src interface{}) (err error)
- func (n *Rat) UnmarshalText(data []byte) error
- func (n Rat) Value() (driver.Value, error)
- type Unix
- func (n *Unix) FromTime(t time.Time)
- func (n Unix) MarshalJSON() ([]byte, error)
- func (n Unix) MarshalText() ([]byte, error)
- func (n *Unix) ParseDefault(v string) error
- func (n Unix) PrimitiveType() core.PrimitiveType
- func (n *Unix) Scan(src interface{}) (err error)
- func (n *Unix) UnmarshalJSON(data []byte) error
- func (n *Unix) UnmarshalText(data []byte) error
- func (n Unix) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decimal ¶
func StringDecimalWithPrecision ¶
StringDecimalWithPrecision 从字符串还原 Decimal 对象
输出精度从 s 获取,如果 s 不包含小数位,则小数长度为 0
func (Decimal) MarshalJSON ¶
func (Decimal) MarshalText ¶
func (*Decimal) ParseDefault ¶
ParseDefault 实现 DefaultParser 接口
func (Decimal) PrimitiveType ¶
func (n Decimal) PrimitiveType() core.PrimitiveType
func (*Decimal) UnmarshalJSON ¶
func (*Decimal) UnmarshalText ¶
type Rat ¶
type Rat struct {
// contains filtered or unexported fields
}
Rat 有理数
这是对 math/big.Rat 的扩展,提供了 orm 需要的接口支持。
在数据库中以分数的形式保存至字符串类型的列,所以需要指定长度。
func (Rat) MarshalText ¶
func (*Rat) ParseDefault ¶
ParseDefault 实现 DefaultParser 接口
func (Rat) PrimitiveType ¶
func (n Rat) PrimitiveType() core.PrimitiveType
func (*Rat) UnmarshalText ¶
type Unix ¶
Unix 以 unix 时间戳保存的 time.Time 数据格式
func (Unix) MarshalJSON ¶
func (Unix) MarshalText ¶
func (*Unix) ParseDefault ¶
ParseDefault 实现 DefaultParser 接口
func (Unix) PrimitiveType ¶
func (n Unix) PrimitiveType() core.PrimitiveType
func (*Unix) UnmarshalJSON ¶
func (*Unix) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.