utils

package
v0.0.0-...-d673ec7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHome

func DefaultHome() string

func DefaultKeystore

func DefaultKeystore() string

func DefaultPassword

func DefaultPassword() string

func ParseBigInt

func ParseBigInt(str string) (*big.Int, error)

func ParseUint64

func ParseUint64(str string) (uint64, error)

func ReadPassphraseFromFile

func ReadPassphraseFromFile(passwordFile string) (string, error)

func ReadPassphraseFromPrompter

func ReadPassphraseFromPrompter() (string, error)

func ReadPassphraseFromPrompter2

func ReadPassphraseFromPrompter2(prompt string) (string, error)

Types

type ChainExecutor

type ChainExecutor struct {
	// contains filtered or unexported fields
}

func (*ChainExecutor) Execute

func (e *ChainExecutor) Execute(handler ExecutorHandler) error

type ContractExecutorWithKeystore

type ContractExecutorWithKeystore struct {
	ChainExecutor
	// contains filtered or unexported fields
}

func (*ContractExecutorWithKeystore) Execute

type ContractExecutorWithPrivateKey

type ContractExecutorWithPrivateKey struct {
	ChainExecutor
	// contains filtered or unexported fields
}

func (*ContractExecutorWithPrivateKey) Execute

type Executor

type Executor interface {
	Execute(handler ExecutorHandler) error
}

func NewChainExecutor

func NewChainExecutor(rpcUrl string) Executor

func NewContractExecutorWithKeystore

func NewContractExecutorWithKeystore(rpcUrl string, keystoreDir string, account string, passphrase string) Executor

func NewContractExecutorWithPrivateKey

func NewContractExecutorWithPrivateKey(rpcUrl string, privateKey []byte) Executor

type ExecutorHandler

type ExecutorHandler func(*ethclient.Client, *bind.TransactOpts) error

type TerminalPrompter

type TerminalPrompter struct {
	// contains filtered or unexported fields
}

TerminalPrompter terminal prompter

func NewTerminalPrompter

func NewTerminalPrompter() *TerminalPrompter

NewTerminalPrompter create a terminal prompter

func (*TerminalPrompter) AppendHistory

func (p *TerminalPrompter) AppendHistory(command string)

AppendHistory appends an entry to the scrollback history.

func (*TerminalPrompter) Prompt

func (p *TerminalPrompter) Prompt(prompt string) (string, error)

Prompt shows the prompt and requests text input returning the input.

func (*TerminalPrompter) PromptConfirm

func (p *TerminalPrompter) PromptConfirm(prompt string) (bool, error)

PromptConfirm shows the prompt to the user and requests a boolean choice to be made, returning that choice.

func (*TerminalPrompter) PromptPassphrase

func (p *TerminalPrompter) PromptPassphrase(prompt string) (passwd string, err error)

PromptPassphrase shows the prompt and request passphrase text input, the passphrase not show, returns the passphrase

func (*TerminalPrompter) SetHistory

func (p *TerminalPrompter) SetHistory(history []string)

SetHistory sets the history that the prompter will allow the user to scroll back to.

func (*TerminalPrompter) SetWordCompleter

func (p *TerminalPrompter) SetWordCompleter(completer liner.WordCompleter)

SetWordCompleter sets the completion function that the prompter will call to fetch completion candidates when the user presses tab.

type UserPrompter

type UserPrompter interface {
	Prompt(prompt string) (string, error)
	PromptPassphrase(prompt string) (passwd string, err error)
	PromptConfirm(prompt string) (bool, error)
	SetHistory(history []string)
	AppendHistory(command string)
	SetWordCompleter(completer liner.WordCompleter)
}

UserPrompter handle console user input interactive

Jump to

Keyboard shortcuts

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