util

package
v0.0.0-...-3cbc91d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

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

Endpoint schemes.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

CheckErr is used to cmd err.

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 InitSignalHandling

func InitSignalHandling(shutdown shutdownNotify, cancel context.CancelFunc)

InitSignalHandling initializes signal handling. It must be called after InitCmd.

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 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