Documentation
¶
Index ¶
- Constants
- Variables
- func HasCurrencyPrefix(s string) bool
- type Amount
- type Balance
- func (b Balance) Add(amount Amount) Balance
- func (b Balance) CommaSeparatedUnsignedWithSymbols(translator interface{ ... }) string
- func (b Balance) Equal(b2 Balance) bool
- func (b Balance) IsZero() bool
- func (b Balance) OnlyNegative() Balance
- func (b Balance) OnlyPositive() Balance
- func (b Balance) Reversed() (reversed Balance)
- type Balanced
- type Currency
- type TestStruct
Constants ¶
View Source
const ( EUR_SIGN = "€" USD_SIGN = "$" GPB_SIGN = "£" JPY_SIGN = "¥" RUR_SIGN = "₽" IRR_SIGN = "﷼" UAH_SIGN = "₴" UZS_SIGN = "сўм" BYN_SIGN = "Br" TJS_SIGN = "смн." KZT_SIGN = "₸" )
Variables ¶
View Source
var CURRENCY_BYN = Currency("BYN")
View Source
var CURRENCY_EUR = Currency("EUR")
View Source
var CURRENCY_GBP = Currency("GPB")
View Source
var CURRENCY_IRR = Currency("IRR")
View Source
var CURRENCY_JPY = Currency("JPY")
View Source
var CURRENCY_KZT = Currency("KZT")
View Source
var CURRENCY_RUB = Currency("RUB")
View Source
var CURRENCY_TJS = Currency("TJS")
View Source
var CURRENCY_UAH = Currency("UAH")
View Source
var CURRENCY_USD = Currency("USD")
View Source
var CURRENCY_UZS = Currency("UZS")
Functions ¶
func HasCurrencyPrefix ¶
Types ¶
type Amount ¶
type Amount struct {
Currency Currency
Value decimal.Decimal64p2
}
func (*Amount) MarshalJSON ¶
func (*Amount) MarshalJSONBuf ¶
func (mj *Amount) MarshalJSONBuf(buf fflib.EncodingBuffer) error
func (*Amount) UnmarshalJSON ¶
func (*Amount) UnmarshalJSONFFLexer ¶
type Balance ¶
type Balance map[Currency]decimal.Decimal64p2
func (Balance) CommaSeparatedUnsignedWithSymbols ¶
func (Balance) OnlyNegative ¶
func (Balance) OnlyPositive ¶
type Balanced ¶
type Balanced struct {
BalanceJson string `datastore:",noindex,omitempty" json:",omitempty"`
LastTransferID int64 `datastore:",noindex,omitempty" json:",omitempty"`
LastTransferAt time.Time `datastore:",noindex,omitempty"` // `json:",omitempty"` - http://stackoverflow.com/questions/32643815/golang-json-omitempty-with-time-time-field
CountOfTransfers int `datastore:",omitempty" json:",omitempty"` // Do not remove, need for hiding balance/history menu in Telegram
BalanceCount int `datastore:",noindex,omitempty" json:"-"`
}
ffjson: skip
func (*Balanced) AddToBalance ¶
func (*Balanced) SetBalance ¶
type TestStruct ¶
Click to show internal directories.
Click to hide internal directories.