cmd

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 29 Imported by: 1

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 added in v0.5.0

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 added in v0.2.1

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

ArgValidatorECAddress checks for EC address

func ArgValidatorFCTAddress added in v0.2.1

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

ArgValidatorFCTAddress checks for FCT address

func ArgValidatorFCTAmount added in v0.2.1

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

func CombineCobraArgs added in v0.2.1

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

CombineCobraArgs allows the combination of multiple PositionalArgs

func CustomArgOrderValidationBuilder added in v0.2.1

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