Documentation ¶
Index ¶
- Variables
- func AddError(el *[]error, e ...error)
- func AddErrorE(el *[]error, e error, f string)
- func AddErrorF(el *[]error, s string, f string)
- func AtExit(f func())
- func Cleanup()
- func Err(err error)
- func ErrS(msg string)
- func Exit(i int, errs ...error)
- func FormValidAddress(s string) bool
- func FormValidName(s string) bool
- func GetErrorField(err error) (s string, b bool)
- func GetErrorMessage(err error, lang ...string) (msg, field string)
- func GetFromCache(id string, exp int64, out any) (found bool)
- func IsError(oB []byte) (err error)
- func JoinErrors(errl []error, nl string) (e error)
- func Money(i, j money.Amount) (o money.Amount)
- func MoneyStr(o money.Amount, c string, l string) (s string)
- func NewSystemError(msg string) (e error)
- func NewUserError(msg string, field string) (e error)
- func Now() time.Time
- func SaveToCache(id string, in any)
- func StrMoney(s string, min, max money.Amount) (amount money.Amount, err error)
- func StrTime(lang string, s string) (time.Time, error)
- func T(fr string) string
- func Translate(t string, lang ...string) string
- func UnauthorizedError() error
- func UntrustedError() error
- type RPC
- type RPCRequest
- type RPCResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var FakedTime time.Time
View Source
var FakedTimeEnabled bool = false
View Source
var TranslateFunction func(fr string, lang string) string = nil
TranslateFunction can be replaced by the user to specify how to translate texts.
View Source
var VerboseRPC bool = os.Getenv("VERBOSE_RPC") != ""
Functions ¶
func AtExit ¶
func AtExit(f func())
AtExit adds a function to the list of functions to be executed when exiting program with Cleanup().
func FormValidAddress ¶
func FormValidName ¶
func GetErrorField ¶
func GetErrorMessage ¶
func JoinErrors ¶
func NewSystemError ¶
func NewUserError ¶
func Now ¶
Now is the same as time.Now() but you can fake the time by setting FAKETIME = "YYYY-MM-DD".
func SaveToCache ¶
func T ¶
T marks a string as translatable. Can be used to extract internationalizable texts from the program.
func UnauthorizedError ¶
func UnauthorizedError() error
func UntrustedError ¶
func UntrustedError() error
Types ¶
type RPCRequest ¶
type RPCResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.