Documentation ¶
Index ¶
- Constants
- func ApplyAction(urls, kind, nodeID string, action string, tlsConfig *tls.Config) error
- func EncryptHandler(text string) error
- func GenerateMetaInfo(cfg *Config) error
- func GetTSO(cfg *Config) (int64, error)
- func QueryNodesByKind(urls string, kind string, showOffline bool, tlsConfig *tls.Config) error
- func UpdateNodeState(urls, kind, nodeID, state string, tlsConfig *tls.Config) error
- type Config
- type Meta
Constants ¶
View Source
const ( // GenerateMeta is command used for generate meta info for drainer's first run. GenerateMeta = "generate_meta" // QueryPumps is command used for query all pump's status. QueryPumps = "pumps" // QueryDrainers is command used for query all drainer's status. QueryDrainers = "drainers" // UpdatePump is command used for update pump's status. UpdatePump = "update-pump" // UpdateDrainer is command used for update drainer's status. UpdateDrainer = "update-drainer" // PausePump is command used for pause pump. PausePump = "pause-pump" // OfflinePump is command used for offline pump. OfflinePump = "offline-pump" // PauseDrainer is comamnd used for pause drainer. PauseDrainer = "pause-drainer" // OfflineDrainer is comamnd used for offlien drainer. OfflineDrainer = "offline-drainer" // Encrypt is command used for encrypt password. Encrypt = "encrypt" )
Variables ¶
This section is empty.
Functions ¶
func ApplyAction ¶
ApplyAction applies action on pump or drainer
func EncryptHandler ¶
EncryptHandler log the encrypted text if success or return error.
func GenerateMetaInfo ¶
GenerateMetaInfo generates Meta from pd
func QueryNodesByKind ¶
QueryNodesByKind returns specified nodes, like pumps/drainers
Types ¶
type Config ¶
type Config struct { *flag.FlagSet `toml:"-" json:"-"` Command string `toml:"cmd" json:"cmd"` NodeID string `toml:"node-id" json:"node-id"` DataDir string `toml:"data-dir" json:"data-dir"` TimeZone string `toml:"time-zone" json:"time-zone"` EtcdURLs string `toml:"pd-urls" json:"pd-urls"` SSLCA string `toml:"ssl-ca" json:"ssl-ca"` SSLCert string `toml:"ssl-cert" json:"ssl-cert"` SSLKey string `toml:"ssl-key" json:"ssl-key"` State string `toml:"state" json:"state"` ShowOfflineNodes bool `toml:"state" json:"show-offline-nodes"` Text string `toml:"text" json:"text"` TLS *tls.Config `toml:"-" json:"-"` // contains filtered or unexported fields }
Config holds the configuration of drainer
Click to show internal directories.
Click to hide internal directories.