Documentation ¶
Index ¶
Constants ¶
View Source
const VERSION = "0.3.0"
VERSION is app version
Variables ¶
View Source
var ( ClusterName string Config *config.ClusterConfig )
View Source
var CheckCmd = &cobra.Command{ Use: "check", Short: "check status of database cluster", Long: `initialize configuration file. `, Run: func(cmd *cobra.Command, args []string) { cmd.Usage() }, }
CheckCmd do check the status of db cluster
View Source
var CheckConnectionCmd = &cobra.Command{ Use: "connection", Short: "check connection status of all nodes", PersistentPreRun: func(cmd *cobra.Command, args []string) { if err := CheckClusterNameArgs(); err != nil { errOutput(cmd, err) } if err := LoadConfig(); err != nil { errOutputExit(cmd, err) } }, Run: CheckConnection, }
CheckConnectionCmd ...
View Source
var ConfigCmd = &cobra.Command{ Use: "config", Short: "operation about configuration file", Long: `configuration file operation. `, Run: func(cmd *cobra.Command, args []string) { cmd.Usage() }, }
ConfigCmd sub-command of zcloud about server
View Source
var ConfigInitCmd = &cobra.Command{ Use: "init", Short: "generate configuration file", PreRun: func(cmd *cobra.Command, args []string) { if err := CheckClusterNameArgs(); err != nil { errOutput(cmd, err) } }, Run: initConfig, }
ConfigInitCmd will generate a configuration file
View Source
var ConfigListCmd = &cobra.Command{
Use: "list",
Short: "list configuration file",
Run: listConfig,
}
ConfigListCmd will list the configuration files in pre-defined path
View Source
var ConfigTestCmd = &cobra.Command{ Use: "test", Short: "test configuration file", PreRun: func(cmd *cobra.Command, args []string) { if err := CheckClusterNameArgs(); err != nil { errOutput(cmd, err) } }, Run: testConfig, }
ConfigTestCmd test target file
View Source
var RootCmd = &cobra.Command{ Use: "zj-db-cluster", Short: "zijin database cluster command line tool", Long: ``, Version: VERSION, Run: func(cmd *cobra.Command, args []string) { cmd.Usage() }, }
RootCmd ...
Functions ¶
func CheckClusterNameArgs ¶
func CheckClusterNameArgs() error
CheckClusterNameArgs will return error if global args ClusterName is ""
Types ¶
type ReplicaStatus ¶
ReplicaStatus ...
func CheckSlaveReplicaStatus ¶
func CheckSlaveReplicaStatus(dbuser string, dbpasswd string, host string, port string) (ReplicaStatus, error)
CheckSlaveReplicaStatus ...
Click to show internal directories.
Click to hide internal directories.