Documentation ¶
Index ¶
- Variables
- func GetDefaultStoragePath(cmd *cobra.Command) string
- func Interrupt(cancel <-chan struct{}) error
- func ParseAmountFromString(input string) (common.Amount, error)
- func PrintError(cmd *cobra.Command, err error)
- func PrintFlagsError(cmd *cobra.Command, flagName string, err error)
- type Encode
- type ListFlags
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultEncodes = map[string]Encode{ "json": func(v interface{}, w io.Writer) error { return jsonEncode(v, w, false) }, "prettyjson": func(v interface{}, w io.Writer) error { return jsonEncode(v, w, true) }, "yaml": func(v interface{}, w io.Writer) error { e := yaml.NewEncoder(w) return e.Encode(v) }, }
Functions ¶
func GetDefaultStoragePath ¶
Get the default value to assign to the `--storage` flag
func ParseAmountFromString ¶
Parse an input string as a monetary amount
Commas (','), and dots ('.') and underscores ('_') are treated as digit separator, and not decimal separators, and will be skipped.
Params:
input = the string representation of the amount, in GON
Returns:
sebak.Amount: the value represented by `input` error: an `error`, if any happened
func PrintError ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.