util

package
v0.0.0-...-e056406 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP  = "http"
	HTTPS = "https"
)

Endpoint schemes.

Variables

This section is empty.

Functions

func InitCmd

func InitCmd(cmd *cobra.Command, logCfg *logutil.Config) context.CancelFunc

InitCmd initializes the logger, the default context and returns its cancel function.

func JSONPrint

func JSONPrint(cmd *cobra.Command, v interface{}) error

JSONPrint will output the data in JSON format.

func LogHTTPProxies

func LogHTTPProxies()

LogHTTPProxies logs HTTP proxy relative environment variables.

func StrictDecodeFile

func StrictDecodeFile(path, component string, cfg interface{}, ignoreCheckItems ...string) error

StrictDecodeFile decodes the toml file strictly. If any item in confFile file is not mapped into the Config struct, issue an error and stop the server from starting.

func VerifyAndGetTiKVCDCClusterVersion

func VerifyAndGetTiKVCDCClusterVersion(
	ctx context.Context, cdcEtcdCli *etcd.CDCEtcdClient,
) (version.TiKVCDCClusterVersion, error)

VerifyAndGetTiKVCDCClusterVersion verifies and gets the version of ticdc. If it is an incompatible version, an error is returned.

func VerifyPdEndpoint

func VerifyPdEndpoint(pdEndpoint string, useTLS bool) error

VerifyPdEndpoint verifies whether the pd endpoint is a valid http or https URL. The certificate is required when using https.

Types

This section is empty.

Jump to

Keyboard shortcuts

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