cli

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnitETH = "ETH"
	UnitWEI = "WEI"

	// UnitList is array for Unit string
	// UnitList = []string{"Wei", "Ada", "Babbage", "Shannon", "Szabo", "Finney", "Ether", "Einstein", "Douglas", "Gwei"}
	UnitList []string

	// UnitString is for Unit string
	// UnitString = "Available unit: Wei, Ada, Babbage, Shannon, Szabo, Finney, Ether, Einstein, Douglas, Gwei"
	UnitString string
)
View Source
var IsDecimalString = regexp.MustCompile(`^[1-9]\d*$|^0$|^0\.\d*$|^[1-9](\d)*\.(\d)*$`).MatchString

Functions

func InitUnit added in v0.6.2

func InitUnit(bc BlockChain)

func TestCLIVersion

func TestCLIVersion(t *testing.T)

TestCLIVersion test cli version

Types

type BlockChain added in v0.6.2

type BlockChain int
const (
	UnknownChain BlockChain = iota
	NewChain
	Ethereum
)

func (BlockChain) Init added in v0.6.2

func (bc BlockChain) Init()

func (BlockChain) String added in v0.6.2

func (bc BlockChain) String() string

type CLI

type CLI struct {
	Name string
	// contains filtered or unexported fields
}

CLI represents a command-line interface. This class is not threadsafe.

func NewCLI

func NewCLI() *CLI

NewCLI returns an initialized CLI

func (*CLI) BuildClient

func (cli *CLI) BuildClient() error

BuildClient BuildClient

func (*CLI) Embeddable

func (cli *CLI) Embeddable() *CLI

Embeddable returns a CLI that you can embed into your own Go programs. This is not thread-safe.

func (*CLI) Execute

func (cli *CLI) Execute()

Execute parses the command line and processes it.

func (*CLI) Run

func (cli *CLI) Run(args ...string) string

Run executes CLI with the given arguments. Used for testing. Not thread safe.

func (*CLI) SetPassword

func (cli *CLI) SetPassword(_passPhrase string) *CLI

SetPassword SetPassword

func (*CLI) TestCommand

func (cli *CLI) TestCommand(command string) string

TestCommand test command

type Unit added in v0.6.2

type Unit string

Jump to

Keyboard shortcuts

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