cmd

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

*

  • @file
  • @copyright defined in aergo/LICENSE.txt

Index

Constants

View Source
const (
	DetailShort   int = -1
	DetailDefault     = 0
	DetailLong        = 1
)
View Source
const (
	EnvironmentPrefix = "AG"
)
View Source
const PeerIDLength = 39

Variables

View Source
var (
	ErrNotExecutedConfChange = errors.New("change cluster request may be not proposed")
)
View Source
var MaxRPCMessageSize = int(types.MaxMessageSize())

Functions

func Execute

func Execute()

func GetClient added in v2.5.0

func GetClient(serverAddr string, opts []grpc.DialOption) interface{}

func GetConn added in v2.5.0

func GetConn(serverAddr string, opts []grpc.DialOption) *grpc.ClientConn

func GetServerAddress

func GetServerAddress() string

GetServerAddress return ip address and port of server

func GetSorter

func GetSorter(cmd *cobra.Command, flag string) peerSorter

func Must

func Must(a0 string, _ error) string

Types

type CliConfig

type CliConfig struct {
	Host         string     `mapstructure:"host" description:"Target server host. default is localhost"`
	Port         int        `mapstructure:"port" description:"Target server port. default is 7845"`
	TLS          *TLSConfig `mapstructure:"tls"`
	KeyStorePath string     `mapstructure:"keystore" description:"Path to keystore directory"`
}

CliConfig is configs for aergo cli.

type CliContext

type CliContext struct {
	config.BaseContext
}

func NewCliContext

func NewCliContext(homePath string, configFilePath string) *CliContext

func (*CliContext) GetConfigFileName

func (ctx *CliContext) GetConfigFileName() string

func (*CliContext) GetDefaultConfig

func (ctx *CliContext) GetDefaultConfig() interface{}

GetDefaultConfig return cliconfig with default value. It ALWAYS returns NEW object.

func (*CliContext) GetDefaultTLSConfig

func (ctx *CliContext) GetDefaultTLSConfig() *TLSConfig

GetDefaultTLSConfig return tlsconfig with default value. It ALWAYS returns NEW object.

func (*CliContext) GetHomePath

func (ctx *CliContext) GetHomePath() string

func (*CliContext) GetTemplate

func (ctx *CliContext) GetTemplate() string

type ConnClient added in v2.5.0

type ConnClient struct {
	types.AergoRPCServiceClient
	// contains filtered or unexported fields
}

func (*ConnClient) Close added in v2.5.0

func (c *ConnClient) Close()

type OutConfChange

type OutConfChange struct {
	Payload  string
	TxStatus *jsonrpc.InOutEnterpriseTxStatus
}

func (*OutConfChange) ToString

func (occ *OutConfChange) ToString() string

type TLSConfig

type TLSConfig struct {
	ServerName string `mapstructure:"servername" description:"Target server name for TLS"`
	CACert     string `mapstructure:"cacert" description:"CA(Certificate Authority) certification file path for TLS"`
	ClientCert string `mapstructure:"clientcert" description:"Client PEM certification file path for TLS"`
	ClientKey  string `mapstructure:"clientkey" description:"Client key file path for TLS"`
}

Directories

Path Synopsis
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.

Jump to

Keyboard shortcuts

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