binlogctl

package
v0.0.0-...-6fba4f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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

func ApplyAction(urls, kind, nodeID string, action string, tlsConfig *tls.Config) error

ApplyAction applies action on pump or drainer

func EncryptHandler

func EncryptHandler(text string) error

EncryptHandler log the encrypted text if success or return error.

func GenerateMetaInfo

func GenerateMetaInfo(cfg *Config) error

GenerateMetaInfo generates Meta from pd

func GetTSO

func GetTSO(cfg *Config) (int64, error)

GetTSO gets ts from pd

func QueryNodesByKind

func QueryNodesByKind(urls string, kind string, showOffline bool, tlsConfig *tls.Config) error

QueryNodesByKind returns specified nodes, like pumps/drainers

func UpdateNodeState

func UpdateNodeState(urls, kind, nodeID, state string, tlsConfig *tls.Config) error

UpdateNodeState update pump or drainer's state.

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

func NewConfig

func NewConfig() *Config

NewConfig returns an instance of configuration

func (*Config) Parse

func (cfg *Config) Parse(args []string) error

Parse parses all config from command-line flags, environment vars or the configuration file

type Meta

type Meta struct {
	CommitTS int64 `toml:"commitTS" json:"commitTS"`
}

Meta contains commit TS that can be used to specifies the location of the synchronized data

func (*Meta) String

func (m *Meta) String() string

String returns the string of Meta

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL