ioctl

package
v1.7.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServiceConfig

type APIServiceConfig struct {
	Endpoint string
	Insecure bool
}

APIServiceConfig defines a config of APIServiceClient

type Client

type Client interface {
	// Start starts the client
	Start(context.Context) error
	// Stop stops the client
	Stop(context.Context) error
	// Config returns the config of the client
	Config() config.Config
	// APIServiceClient returns an API service client
	APIServiceClient(APIServiceConfig) (iotexapi.APIServiceClient, error)
	// SelectTranslation select a translation based on UILanguage
	SelectTranslation(map[config.Language]string) (string, config.Language)
	// AskToConfirm asks user to confirm from terminal, true to continue
	AskToConfirm(string) bool
	// ReadSecret reads password from terminal
	ReadSecret() (string, error)
	// Execute a bash command
	Execute(string) error
	// AddressWithDefaultIfNotExist returns default address if input empty
	AddressWithDefaultIfNotExist(in string) (string, error)
	// Address returns address if input address|alias
	Address(in string) (string, error)
	// NewKeyStore creates a keystore by default walletdir
	NewKeyStore() *keystore.KeyStore
	// DecryptPrivateKey returns privateKey from a json blob
	DecryptPrivateKey(string, string) (*ecdsa.PrivateKey, error)
	// AliasMap returns the alias map: accountAddr-aliasName
	AliasMap() map[string]string
	// SetAlias write alias and account address to the default config file
	SetAlias(string, string) error
	// DeleteAlias delete alias from the default config file
	DeleteAlias(string) error
	// PrintInfo print the command result or the question query
	PrintInfo(string)
	// IsCryptoSm2 return true if use sm2 cryptographic algorithm, false if not use
	IsCryptoSm2() bool
}

Client defines the interface of an ioctl client

func NewClient

func NewClient(cfg config.Config, configFilePath string, opts ...Option) Client

NewClient creates a new ioctl client

type ConfirmationMessage added in v1.7.1

type ConfirmationMessage struct {
	Info    string   `json:"info"`
	Options []string `json:"options"`
}

ConfirmationMessage is the struct of an Confirmation output

func (*ConfirmationMessage) String added in v1.7.1

func (m *ConfirmationMessage) String() string

type Option added in v1.7.1

type Option func(*client)

Option sets client construction parameter

func EnableCryptoSm2 added in v1.7.1

func EnableCryptoSm2() Option

EnableCryptoSm2 enables to use sm2 cryptographic algorithm

Jump to

Keyboard shortcuts

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