cli

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Conn is a connection to the node

Functions

func AddressArgFunc

func AddressArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is a common.Address.

func AddressArgOrKeystoreAddressFunc

func AddressArgOrKeystoreAddressFunc(key string, index int) func(*cobra.Command, []string) error

AddressArgOrKeystoreAddressFunc returns a cobra.Command Arg function to validate that either the 'keystoreAddress' arg is set, or a config file value is set.

func BigFloatArgFunc

func BigFloatArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is a big.Float.

func BigIntArgFunc

func BigIntArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is a big.Int.

func BoolArgFunc

func BoolArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is a bool.

func ChainArgs

func ChainArgs(funcs ...func(cmd *cobra.Command, args []string) error) func(*cobra.Command, []string) error

ChainArgs chains the given args functions for use as a single cobra.Command Args.

func CheckAccreditationGetter

func CheckAccreditationGetter(cmd *cobra.Command) func(*big.Int, error)

func CheckAddressGetter

func CheckAddressGetter(cmd *cobra.Command) func(common.Address, error)

CheckGetter prints the given error and exits, if the error is not nil, otherwise the returned address is printed.

func CheckCountryGetter

func CheckCountryGetter(cmd *cobra.Command) func([2]byte, error)

func CheckErr

func CheckErr(cmd *cobra.Command, err error)

CheckErr prints the given error and exits, if the error is not nil.

func CheckGetter

func CheckGetter(cmd *cobra.Command) func(interface{}, error)

CheckGetter prints the given error and exits, if the error is not nil, otherwise the return value is printed.

func CheckHashGetter

func CheckHashGetter(cmd *cobra.Command) func([32]byte, error)

func Connect

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

Connect creates a connection to the node

func ConnectWithKeyStore

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

Connect creates a connection to the node, using the address from the keystore as the transactor

func CountryCodeArgFunc

func CountryCodeArgFunc(key string, index int) func(*cobra.Command, []string) error

CountryCodeArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a valid country code.

func CountryFromArg

func CountryFromArg(s string) ([2]byte, error)

CountryFromArg returns the country code in bytes.

func DateArgFunc

func DateArgFunc(key string, index int) func(*cobra.Command, []string) error

DateArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a valid date.

func DateFromArg

func DateFromArg(s string) (time.Time, error)

DateFromArg returns the parsed string as a date.

func FlagOrConfigAddress

func FlagOrConfigAddress(cmd *cobra.Command, flag, configKey string) (common.Address, error)

FlagOrConfigAddress returns the address of the given flag, when set, or the matching address for the given key, within the config file.

func GetArgAddress

func GetArgAddress(index int, args []string) (common.Address, error)

GetArgAddress returns the address for the argument at the specified index.

func HexArgFunc

func HexArgFunc(key string, index int, length int) func(*cobra.Command, []string) error

HexArgFunc returns a cobra.Command Arg function that validates the argument at the given index is a hex string of the given length.

func IntArgFunc

func IntArgFunc(key string, index int) func(*cobra.Command, []string) error

BoolArgFunc returns a cobra.Command Arg function to validate the given argument index is an int.

func IsAddress

func IsAddress(s string) error

IsAddress checks if the given string is a valid address.

func IsAddressArg

func IsAddressArg(key string, args []string, i int) error

IsAddressArg validates that the args contains enough values, and if the given argument position is a valid address.

func IsIntArg

func IsIntArg(key string, args []string, i int) error

IsAddressArg validates that the args contains enough values, and if the given argument position is an int.

func NewConnection

func NewConnection(cmd *cobra.Command, args []string) (*connection.Connection, error)

func NewKeystoreConnection

func NewKeystoreConnection(cmd *cobra.Command, args []string) (*connection.Connection, error)

func PrintTransFn

func PrintTransFn(cmd *cobra.Command) func(*types.Transaction, error)

PrintTransFn returns a function that checks for an error, printing the transaction when successful.

func PrintTransaction

func PrintTransaction(cmd *cobra.Command, tx *types.Transaction)

PrintTransaction prints the transaction info.

func UintArgFunc

func UintArgFunc(key string, index, bitSize int) func(*cobra.Command, []string) error

UintArgFunc returns a cobra.Command Arg function to validate the given argument index is an uint of the specified bit size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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