cli

package
v1.1.0-hotfix Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeyStorePass = "gochain"
)
View Source
const (
	FlagAnnotationCustom = "custom"
)
View Source
const (
	TableCellDisplayNil = "-"
)

Variables

View Source
var (
	CuiQuitKeyEvtFunc  = func(g *gocui.Gui, v *gocui.View) error { return gocui.ErrQuit }
	CuiQuitUserEvtFunc = func(g *gocui.Gui) error { return gocui.ErrQuit }
	CuiNilUserEvtFunc  = func(g *gocui.Gui) error { return nil }
)

Functions

func AddAdminRequiredFlags

func AddAdminRequiredFlags(c *cobra.Command)

func AddDebugRequiredFlags

func AddDebugRequiredFlags(c *cobra.Command)

func AddRpcRequiredFlags

func AddRpcRequiredFlags(c *cobra.Command)

func AdminPersistentPreRunE

func AdminPersistentPreRunE(vc *viper.Viper, adminClient *node.UnixDomainSockHttpClient) func(cmd *cobra.Command, args []string) error

func ArgsWithDefaultErrorFunc

func ArgsWithDefaultErrorFunc(arg cobra.PositionalArgs) cobra.PositionalArgs

func ArgsWithErrorFunc

func ArgsWithErrorFunc(arg cobra.PositionalArgs,
	errFunc func(cmd *cobra.Command, err error) error) cobra.PositionalArgs

func BindPFlags

func BindPFlags(vc *viper.Viper, pFlags *pflag.FlagSet) error

func CheckFlagsWithViper added in v1.1.0

func CheckFlagsWithViper(vc *viper.Viper, fs *pflag.FlagSet, flagNames ...string) error

func CommandPathToMarkdown

func CommandPathToMarkdown(buf *bytes.Buffer, cmd *cobra.Command)

func DebugPersistentPreRunE

func DebugPersistentPreRunE(vc *viper.Viper, dbgClient *client.JsonRpcClient) func(cmd *cobra.Command, args []string) error

func DefaultArgErrorFunc

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

func DefaultFlagErrorFunc

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

func FlagToMarkdown

func FlagToMarkdown(buf *bytes.Buffer, vcs ...*viper.Viper) func(f *pflag.Flag)

func GenerateMarkdown

func GenerateMarkdown(cmd *cobra.Command, parentVc *viper.Viper, w io.Writer)

func GetStringMap

func GetStringMap(f *pflag.Flag) (map[string]interface{}, error)

func HttpResponsePrettyPrintln

func HttpResponsePrettyPrintln(w io.Writer, resp *http.Response) error

func IsDirectory

func IsDirectory(p string) (bool, error)

func JsonPrettyCopyAndClose

func JsonPrettyCopyAndClose(w io.Writer, r io.ReadCloser) error

func JsonPrettyPrintln

func JsonPrettyPrintln(w io.Writer, v interface{}) error

func JsonPrettySaveFile

func JsonPrettySaveFile(filename string, perm os.FileMode, v interface{}) error

func MarkAnnotationCustom

func MarkAnnotationCustom(fs *pflag.FlagSet, names ...string) error

func MarkAnnotationHidden

func MarkAnnotationHidden(fs *pflag.FlagSet, names ...string) error

func MarkAnnotationRequired

func MarkAnnotationRequired(fs *pflag.FlagSet, names ...string) error

func MergeWithViper

func MergeWithViper(vc *viper.Viper, cfg *ServerConfig) error

func NewBackupCmd

func NewBackupCmd(parent *cobra.Command, client *node.UnixDomainSockHttpClient)

func NewChainCmd

func NewChainCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewCommand

func NewCommand(parentCmd *cobra.Command, parentVc *viper.Viper, use, short string) (*cobra.Command, *viper.Viper)

func NewCui

func NewCui() (*gocui.Gui, <-chan bool)

func NewDebugCmd

func NewDebugCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewGStorageCmd

func NewGStorageCmd(c string) *cobra.Command

func NewGenerateMarkdownCommand

func NewGenerateMarkdownCommand(parentCmd *cobra.Command, parentVc *viper.Viper) *cobra.Command

func NewGenesisCmd

func NewGenesisCmd(c string) *cobra.Command

func NewKeystoreCmd

func NewKeystoreCmd(c string) *cobra.Command

func NewMonitorCmd

func NewMonitorCmd(parentCmd *cobra.Command, parentVc *viper.Viper) *cobra.Command

func NewRestoreCmd

func NewRestoreCmd(parent *cobra.Command, client *node.UnixDomainSockHttpClient)

func NewRpcCmd

func NewRpcCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewSendTxCmd

func NewSendTxCmd(parentCmd *cobra.Command, parentVc *viper.Viper) *cobra.Command

func NewServerCmd

func NewServerCmd(parentCmd *cobra.Command, parentVc *viper.Viper, version, build string, logoLines []string) (*cobra.Command, *viper.Viper)

func NewStatsCmd

func NewStatsCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewSystemCmd

func NewSystemCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewUserCmd

func NewUserCmd(parentCmd *cobra.Command, parentVc *viper.Viper) (*cobra.Command, *viper.Viper)

func NewViper

func NewViper(envPrefix string) *viper.Viper

func OnInterrupt

func OnInterrupt(cb func())

func OrArgs

func OrArgs(pArgs ...cobra.PositionalArgs) cobra.PositionalArgs

func ReadFile added in v0.9.6

func ReadFile(name string) ([]byte, error)

func ReadParam added in v0.9.6

func ReadParam(param string) ([]byte, error)

func RpcPersistentPreRunE

func RpcPersistentPreRunE(vc *viper.Viper, rpcClient *client.ClientV3) func(cmd *cobra.Command, args []string) error

func StartCPUProfile

func StartCPUProfile(filename string) error

func StartMemoryProfile

func StartMemoryProfile(filename string) error

func StatsViewToTable

func StatsViewToTable(v *node.StatsView, maxColWidth uint) *uitable.Table

func TermGui

func TermGui(g *gocui.Gui, termCh <-chan bool)

func UpdateCuiByStatsViewStream

func UpdateCuiByStatsViewStream(g *gocui.Gui) node.StreamCallbackFunc

func ValidateFlags

func ValidateFlags(fs *pflag.FlagSet, flagNames ...string) error

func ValidateFlagsWithViper

func ValidateFlagsWithViper(vc *viper.Viper, fs *pflag.FlagSet, flagNames ...string) error

func ViperDecodeOptJson

func ViperDecodeOptJson(c *mapstructure.DecoderConfig)

func ZipDirectory

func ZipDirectory(p string, excludes ...string) ([]byte, error)

Types

type ServerConfig

type ServerConfig struct {
	node.StaticConfig

	KeyStoreData json.RawMessage `json:"key_store,omitempty"`
	KeyStorePass string          `json:"key_password,omitempty"`

	KeyPlugin     string            `json:"key_plugin,omitempty"`
	KeyPlgOptions map[string]string `json:"key_plugin_options,omitempty"`

	Wallet module.Wallet `json:"-"`

	LogLevel     string               `json:"log_level"`
	ConsoleLevel string               `json:"console_level"`
	LogForwarder *log.ForwarderConfig `json:"log_forwarder,omitempty"`
	LogWriter    *log.WriterConfig    `json:"log_writer,omitempty"`
	// contains filtered or unexported fields
}

func (*ServerConfig) GetAddress

func (cfg *ServerConfig) GetAddress() module.Address

func (*ServerConfig) MakesureWallet

func (cfg *ServerConfig) MakesureWallet(gen bool) error

func (*ServerConfig) SetFilePath

func (cfg *ServerConfig) SetFilePath(path string) string

Jump to

Keyboard shortcuts

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