Documentation
¶
Index ¶
- Constants
- func GetFileInode(path string) (uint64, error)
- func GetKeyValueFromJsonMetric(metricRet string, key string) (string, *cmderror.CmdError)
- func GetMdsLeader(mdsAddrs []string) (string, bool)
- func GetMetricValue(metricRet string) (string, *cmderror.CmdError)
- func GetResuestHosts(reqAddrs []string) []string
- func GetRpcListResponse(rpcList []*Rpc, rpcFunc []RpcFunc) ([]interface{}, []*cmderror.CmdError)
- func GetRpcResponse(rpc *Rpc, rpcFunc RpcFunc) (interface{}, *cmderror.CmdError)
- func NewFinalDingoCli(cli *FinalDingoCmd, funcs FinalDingoCmdFunc) *cobra.Command
- func NewMidDingoCli(cli *MidDingoCmd, add MidDingoCmdFunc) *cobra.Command
- func QueryMetric(m *Metric) (string, *cmderror.CmdError)
- type ConnectionPool
- type FinalDingoCmd
- type FinalDingoCmdFunc
- type LeaderMetaCache
- type Metric
- type MetricResult
- type MidDingoCmd
- type MidDingoCmdFunc
- type Result
- type Rpc
- type RpcFunc
- type RpcResult
Constants ¶
View Source
const (
CURL_VERSION = "curl/7.54.0"
)
Variables ¶
This section is empty.
Functions ¶
func GetRpcListResponse ¶
func GetRpcResponse ¶
func NewFinalDingoCli ¶
func NewFinalDingoCli(cli *FinalDingoCmd, funcs FinalDingoCmdFunc) *cobra.Command
func NewMidDingoCli ¶
func NewMidDingoCli(cli *MidDingoCmd, add MidDingoCmdFunc) *cobra.Command
Types ¶
type ConnectionPool ¶
type ConnectionPool struct {
// contains filtered or unexported fields
}
func NewConnectionPool ¶
func NewConnectionPool() *ConnectionPool
func (*ConnectionPool) GetConnection ¶
func (c *ConnectionPool) GetConnection(address string, timeout time.Duration) (*grpc.ClientConn, error)
func (*ConnectionPool) PutConnection ¶
func (c *ConnectionPool) PutConnection(address string, conn *grpc.ClientConn)
func (*ConnectionPool) Release ¶
func (c *ConnectionPool) Release(address string)
type FinalDingoCmd ¶
type FinalDingoCmd struct {
Use string `json:"-"`
Short string `json:"-"`
Long string `json:"-"`
Example string `json:"-"`
Error *cmderror.CmdError `json:"error"`
Result interface{} `json:"result"`
TableNew *tablewriter.Table `json:"-"`
Header []string `json:"-"`
Cmd *cobra.Command `json:"-"`
}
FinalDingoCmd is the final executable command, it has no subcommands. The execution process is Init->RunCommand->Print. Error Use to indicate whether the command is wrong and the reason for the execution error
func (*FinalDingoCmd) SetHeader ¶
func (fc *FinalDingoCmd) SetHeader(header []string)
type FinalDingoCmdFunc ¶
type FinalDingoCmdFunc interface {
Init(cmd *cobra.Command, args []string) error
RunCommand(cmd *cobra.Command, args []string) error
Print(cmd *cobra.Command, args []string) error
// result in plain format string
ResultPlainOutput() error
AddFlags()
}
FinalDingoCmdFunc is the function type for final command If there is flag[required] related code should not be placed in init, the check for it is placed between PreRun and Run
type LeaderMetaCache ¶
type LeaderMetaCache struct {
// contains filtered or unexported fields
}
type MetricResult ¶
type MidDingoCmd ¶
MidDingoCmd is the middle command and has subcommands. If you execute this command you will be prompted which subcommands are included
type MidDingoCmdFunc ¶
type MidDingoCmdFunc interface {
AddSubCommands()
}
Add subcommand for MidDingoCmd
type Rpc ¶
Click to show internal directories.
Click to hide internal directories.