Documentation ¶
Index ¶
- Constants
- func MarshalFileData(src []byte) graphql.Marshaler
- func UnmarshalFileData(v interface{}) ([]byte, error)
- type Amount
- func (a Amount) Add(arr ...Amount) (Amount, error)
- func (a Amount) EncodeValues(key string, v *url.Values) error
- func (a *Amount) Equal(y Amount) bool
- func (a Amount) MarshalGQL(w io.Writer)
- func (a *Amount) MarshalJSON() ([]byte, error)
- func (a Amount) Mul(y Amount) (Amount, error)
- func (a Amount) MultiplyRatio(r Ratio) (Amount, error)
- func (a *Amount) Scan(value interface{}) error
- func (a Amount) Sub(arr ...Amount) (Amount, error)
- func (a *Amount) UnmarshalGQL(v interface{}) error
- func (a *Amount) UnmarshalJSON(b []byte) error
- func (a Amount) Value() (driver.Value, error)
- type BigID
- type BigIDArray
- type FileData
- type Flow
- func (a Flow) Add(arr ...Flow) (Flow, error)
- func (a Flow) EncodeValues(key string, v *url.Values) error
- func (a *Flow) Equal(y Flow) bool
- func (a Flow) MarshalGQL(w io.Writer)
- func (a *Flow) MarshalJSON() ([]byte, error)
- func (a Flow) Mul(y Flow) (Flow, error)
- func (a *Flow) Scan(value interface{}) error
- func (a Flow) Sub(arr ...Flow) (Flow, error)
- func (a *Flow) UnmarshalGQL(v interface{}) error
- func (a *Flow) UnmarshalJSON(b []byte) error
- func (a Flow) Value() (driver.Value, error)
- type ID
- type IDArray
- type IP
- type IPArray
- type JSONList
- type JSONMap
- type Ratio
- func (r Ratio) Add(arr ...Ratio) (Ratio, error)
- func (r Ratio) Decimal() decimal.Decimal
- func (r Ratio) EncodeValues(key string, v *url.Values) error
- func (r Ratio) MarshalGQL(w io.Writer)
- func (r *Ratio) MarshalJSON() ([]byte, error)
- func (r Ratio) Mul(arr ...Ratio) (Ratio, error)
- func (r Ratio) MultiplyAmount(amount Amount) (Amount, error)
- func (r Ratio) Sub(arr ...Ratio) (Ratio, error)
- func (r *Ratio) UnmarshalGQL(v interface{}) error
- func (r *Ratio) UnmarshalJSON(b []byte) error
- type SmallID
- type SmallIDArray
- type TextArray
- type TimeArray
- type TinyID
- type TinyIDArray
Constants ¶
View Source
const TIMEZONE_LAYOUT = "2006-01-02 15:04:05-07"
Variables ¶
This section is empty.
Functions ¶
func MarshalFileData ¶ added in v0.1.3
func UnmarshalFileData ¶ added in v0.1.3
Types ¶
type Amount ¶
* 在資料庫使用此欄位時,要使用NUMRIC避免精度消失 * 只要金錢相關的欄位都應該用此type,避免計算過程有精度消失的問題
func NewAmountFromString ¶
func (Amount) MarshalGQL ¶
func (*Amount) MarshalJSON ¶
func (*Amount) UnmarshalGQL ¶
func (*Amount) UnmarshalJSON ¶
type BigIDArray ¶
type BigIDArray []BigID
func (*BigIDArray) Includes ¶ added in v0.1.3
func (ids *BigIDArray) Includes(target BigID) bool
func (BigIDArray) MarshalGQL ¶
func (arr BigIDArray) MarshalGQL(w io.Writer)
func (*BigIDArray) Scan ¶
func (ids *BigIDArray) Scan(value interface{}) error
func (*BigIDArray) UnmarshalGQL ¶
func (id *BigIDArray) UnmarshalGQL(v interface{}) error
type Flow ¶ added in v0.1.6
* 在資料庫使用此欄位時,要使用NUMRIC避免精度消失 * 只要金錢相關的欄位都應該用此type,避免計算過程有精度消失的問題 * Flow可以是負數
func NewFlowFromString ¶ added in v0.1.6
func (Flow) EncodeValues ¶ added in v0.1.6
func (Flow) MarshalGQL ¶ added in v0.1.6
func (*Flow) MarshalJSON ¶ added in v0.1.6
func (*Flow) UnmarshalGQL ¶ added in v0.1.6
func (*Flow) UnmarshalJSON ¶ added in v0.1.6
type IP ¶ added in v0.1.3
type IP string
func (IP) MarshalGQL ¶ added in v0.1.3
func (*IP) UnmarshalGQL ¶ added in v0.1.3
type JSONList ¶ added in v0.1.3
type JSONList []interface{}
func (JSONList) MarshalGQL ¶ added in v0.1.3
func (*JSONList) UnmarshalGQL ¶ added in v0.1.3
type JSONMap ¶ added in v0.1.3
type JSONMap map[string]interface{}
func (JSONMap) MarshalGQL ¶ added in v0.1.3
func (*JSONMap) UnmarshalGQL ¶ added in v0.1.3
type Ratio ¶
type Ratio uint64
* 1點為0.00000001 * 在資料庫使用此欄位時,須使用BIGINT * 在資料庫不使用NUMEIC是因為這樣容量需求比較小(8 bytes) * MaxUint64: 9223372036854775807
func MultiplyRatios ¶ added in v0.1.2
func NewRatioFromDecimal ¶
最小單位0.00000001,小於0.00000001的值將會被忽略 最終都要由NewRatioFromDecimal來生成Ratio, 才會檢查該值的合理性
func NewRatioFromString ¶
str: 輸入最小單位0.00000001,小於0.00000001的值將會被忽略
func (Ratio) MarshalGQL ¶
func (*Ratio) MarshalJSON ¶
func (*Ratio) UnmarshalGQL ¶
func (*Ratio) UnmarshalJSON ¶
type SmallIDArray ¶
type SmallIDArray []SmallID
func (*SmallIDArray) Includes ¶ added in v0.1.3
func (ids *SmallIDArray) Includes(target SmallID) bool
func (SmallIDArray) MarshalGQL ¶
func (arr SmallIDArray) MarshalGQL(w io.Writer)
func (*SmallIDArray) Scan ¶
func (ids *SmallIDArray) Scan(value interface{}) error
func (*SmallIDArray) UnmarshalGQL ¶
func (id *SmallIDArray) UnmarshalGQL(v interface{}) error
type TinyIDArray ¶
type TinyIDArray []TinyID
func (*TinyIDArray) Includes ¶ added in v0.1.3
func (ids *TinyIDArray) Includes(target TinyID) bool
func (TinyIDArray) MarshalGQL ¶
func (arr TinyIDArray) MarshalGQL(w io.Writer)
func (*TinyIDArray) Scan ¶
func (ids *TinyIDArray) Scan(value interface{}) error
func (*TinyIDArray) UnmarshalGQL ¶
func (id *TinyIDArray) UnmarshalGQL(v interface{}) error
Click to show internal directories.
Click to hide internal directories.