Documentation
¶
Index ¶
- func ExtractSQLsFromArgs(args []string) ([]string, error)
- func GetFileContent(fpath string) ([]byte, error)
- func GetWorkerArgs(cmd *cobra.Command) ([]string, error)
- func InitClient(addr string, mode DmctlMode) error
- func IsDDL(sql string) (bool, error)
- func MasterClient() pb.MasterClient
- func PrettyPrintResponse(resp proto.Message)
- func PrintLines(format string, a ...interface{})
- func WorkerClient() pb.WorkerClient
- type Config
- type DmctlMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractSQLsFromArgs ¶
ExtractSQLsFromArgs extract multiple sql from args.
func GetFileContent ¶
GetFileContent reads and returns file's content
func GetWorkerArgs ¶
GetWorkerArgs extracts workers from cmd
func InitClient ¶
InitClient initializes dm-worker client or dm-master client
func PrettyPrintResponse ¶
PrettyPrintResponse prints a PRC response prettily
func PrintLines ¶
func PrintLines(format string, a ...interface{})
PrintLines adds a wrap to support `\n` within `chzyer/readline`
Types ¶
type Config ¶
type Config struct {
*flag.FlagSet `json:"-"`
MasterAddr string `toml:"master-addr" json:"master-addr"`
// supporting dmctl connect to dm-worker directly, but not export to config
// now we don't add authentication in dm-worker's gRPC server
WorkerAddr string `toml:"worker-addr" json:"-"`
ServerAddr string `json:"-"` // MasterAddr or WorkerAddr
Mode DmctlMode `json:"-"`
ConfigFile string `json:"config-file"`
// contains filtered or unexported fields
}
Config is the configuration.
Click to show internal directories.
Click to hide internal directories.