Documentation ¶
Index ¶
- Constants
- func ExtractSQLsFromArgs(args []string) ([]string, error)
- func GetFileContent(fpath string) ([]byte, error)
- func GetWorkerArgs(cmd *cobra.Command) ([]string, error)
- func InitClient(addr string) error
- func InitUtils(cfg *Config) error
- func IsDDL(sql string) (bool, error)
- func MasterClient() pb.MasterClient
- func OperateRelay(op pb.RelayOp, workers []string) (*pb.OperateWorkerRelayResponse, error)
- func OperateTask(op pb.TaskOp, name string, workers []string) (*pb.OperateTaskResponse, error)
- func PrettyPrintInterface(resp interface{})
- func PrettyPrintResponse(resp proto.Message)
- func PrettyPrintResponseWithCheckTask(resp proto.Message, subStr string) bool
- func PrintLines(format string, a ...interface{})
- type Config
Constants ¶
const ( // EncryptCmdName is special command EncryptCmdName = "encrypt" // DecryptCmdName is special command DecryptCmdName = "decrypt" )
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 OperateRelay ¶
OperateRelay does operation on relay unit
func OperateTask ¶
OperateTask does operation on task
func PrettyPrintInterface ¶ added in v1.0.2
func PrettyPrintInterface(resp interface{})
PrettyPrintInterface prints an interface through encoding/json prettily
func PrettyPrintResponse ¶
PrettyPrintResponse prints a PRC response prettily
func PrettyPrintResponseWithCheckTask ¶
PrettyPrintResponseWithCheckTask prints a RPC response may contain response Msg with check-task's response prettily. check-task's response may contain json-string when checking fail in `detail` field. ugly code, but it is a little hard to refine this because needing to convert type.
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"` RPCTimeoutStr string `toml:"rpc-timeout" json:"rpc-timeout"` RPCTimeout time.Duration `json:"-"` ConfigFile string `json:"config-file"` // contains filtered or unexported fields }
Config is the configuration.