cmd

package
v0.0.0-...-4a3476f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Flags
	ADD_ANY       = ^uint8(0) // Indicates all address types (all bits set)
	ADD_FA  uint8 = 1 << iota
	ADD_Fs
	ADD_EC
	ADD_Es
	ADD_Fe
	ADD_FE
	ADD_ETHS
)

Variables

This section is empty.

Functions

func ArgValidatorAddress

func ArgValidatorAddress(flag uint8) func(cmd *cobra.Command, arg string) error

func ArgValidatorAssetOrP

func ArgValidatorAssetOrP(cmd *cobra.Command, arg string) error

ArgValidatorAssetAndAll checks for valid asset or 'all'

func ArgValidatorECAddress

func ArgValidatorECAddress(cmd *cobra.Command, arg string) error

ArgValidatorECAddress checks for EC address

func ArgValidatorFCTAddress

func ArgValidatorFCTAddress(cmd *cobra.Command, arg string) error

ArgValidatorFCTAddress checks for FCT address

func ArgValidatorFCTAmount

func ArgValidatorFCTAmount(cmd *cobra.Command, arg string) error

func CombineCobraArgs

func CombineCobraArgs(funcs ...cobra.PositionalArgs) cobra.PositionalArgs

CombineCobraArgs allows the combination of multiple PositionalArgs

func CustomArgOrderValidationBuilder

func CustomArgOrderValidationBuilder(strict bool, valids ...func(cmd *cobra.Command, args string) error) cobra.PositionalArgs

CustomArgOrderValidationBuilder return an arg validator. The arg validator will validate cli arguments based on the validation functions provided in the order of the validation functions.

Params:
	strict		Enforce the number of args == number of validation funcs
	valids		Validation functions

func Execute

func Execute()

Execute is cobra's entry point

func FactoidToFactoshi

func FactoidToFactoshi(amt string) (uint64, error)

FactoidToFactoshi is taken from the factom lib, but errors when extra decimals provided

func FactoshiToFactoid

func FactoshiToFactoid(i int64) string

FactoshiToFactoid converts a uint64 factoshi amount into a fixed point number represented as a string

func ReadConfig

func ReadConfig(cmd *cobra.Command, args []string)

ReadConfig can be put as a PreRun for a command that uses the config file

func SoftReadConfig

func SoftReadConfig(cmd *cobra.Command, args []string)

SoftReadConfig will not fail. It can be used for a command that needs the config, but is happy with the defaults

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL