package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Packages
Package mock is just for test only.
# Functions
CheckIfSameCluster reads PD addresses registered in etcd from two sources, to check if there are common addresses in both sources.
CheckSupportX509NameOneline parses and validate input str is X509_NAME_oneline format and precheck check-item is supported by TiDB https://www.openssl.org/docs/manmaster/man3/X509_NAME_oneline.html.
ClientWithTLS creates a http client wit tls.
ColumnsToProto converts a slice of model.ColumnInfo to a slice of tipb.ColumnInfo.
ColumnToProto converts model.ColumnInfo to tipb.ColumnInfo.
ComposeURL adds HTTP schema if missing and concats address with path.
CreateCertificates creates and writes a cert based on the params.
DelKeyWithPrefix deletes keys with prefix.
FmtNonASCIIPrintableCharToHex turns non-printable-ASCII characters into Hex.
FormatLeaseID formats lease id to hex string as what etcdctl does.
GenLogFields generate log fields.
GenRLimit get RLIMIT_NOFILE limit.
GetCPUPercentage calculates CPU usage and returns percentage in float64(e.g.
GetGOGC returns the current value of GOGC.
GetJSON fetches a page and parses it as JSON.
GetLocalIP will return a local IP(non-loopback, non 0.0.0.0), if there is one.
GetPDsAddrWithoutScheme returns a function that read all PD nodes' first etcd client URL by SQL query.
GetRawInfo do what its name tells nolint:unused.
GetRecoverError gets the error from recover.
GetValuesList is used to get `num` values between lower and upper value.
HasCancelled checks whether context has be cancelled.
InternalHTTPClient is used by TiDB-Server to request other components.
InternalHTTPSchema specifies use http or https to request other components.
IsInCorrectIdentifierName checks if the identifier is incorrect.
IsMemDB checks whether dbLowerName is memory database.
IsMemOrSysDB uses to check whether dbLowerName is memory database or system database.
IsSysDB checks whether dbLowerName is system database.
IsSystemView is similar to IsMemOrSyDB, but does not include the mysql schema.
LoadTLSCertificates loads CA/KEY/CERT for special paths.
MockPkixAttribute generates mock AttributeTypeAndValue.
NewErrorGroupWithRecover creates a ErrorGroupWithRecover.
NewErrorGroupWithRecoverWithCtx is like errgroup.WithContext, but returns a ErrorGroupWithRecover.
NewSession creates a new etcd session.
NewSessionPool creates a new session pool with the given capacity and factory function.
NewTCPConnWithIOCounter creates a new TCPConnWithIOCounter.
NewTLS constructs a new HTTP client with TLS configured with the CA, certificate and key paths.
NewTLSConfig creates a tls.Config from the given options.
NewTokenLimiter creates a TokenLimiter with count tokens.
NewWaitGroupEnhancedWrapper returns WaitGroupEnhancedWrapper, the empty source indicates the unit test, then the `checkUnExitedProcess` won't be executed.
NewWaitGroupPool returns WaitGroupPool.
NewWorkerPool returns a WorkPool.
OriginError return original err.
ParseAndCheckSAN parses and check SAN str.
ParseHostPortAddr returns a scheme://host:port or host:port list.
PrintableASCII detects if b is a printable ASCII character.
PrintInfo prints the app's basic information in log nolint:unused.
ReadLine tries to read a complete line from bufio.Reader.
ReadLines tries to read lines from bufio.Reader.
Recover includes operations such as recovering, clearing,and printing information.
RowKeyPrefixFilter returns a function which checks whether currentKey has decoded rowKeyPrefix as prefix.
RunWithRetry will run the f with backoff and retry.
ScanMetaWithPrefix scans metadata with the prefix.
SetGOGC update GOGC and related metrics.
SliceToMap converts slice to map nolint:unused.
Str2Int64Map converts a string to a map[int64]struct{}.
StringsToInterfaces converts string slice to interface slice.
SyntaxError converts parser error to TiDB's syntax error.
SyntaxWarn converts parser warn to TiDB's syntax warn.
TLSCipher2String convert tls num to string.
ToTLSConfig generates tls's config.
ToTLSConfigWithVerify constructs a `*tls.Config` from the CA, certification and key paths, and add verify for CN.
WithCAContent sets the CA content to build a tls.Config, and the peer should use the certificate which can be verified by this CA.
WithCAPath sets the CA path to build a tls.Config, and the peer should use the certificate which can be verified by this CA.
WithCertAndKeyContent sets the client certificate and primary key content to build a tls.Config.
WithCertAndKeyPath sets the client certificate and primary key path to build a tls.Config.
WithMinTLSVersion sets the min tls version to build a tls.Config.
WithRecovery wraps goroutine startup call with force recovery.
WithVerifyCommonName sets the Common Name the peer must provide before starting a TLS connection.
X509NameOnline prints pkix.Name into old X509_NAME_oneline format.
# Constants
CommonName is type name for common name.
Country is type name for country.
DefaultMaxRetries indicates the max retry count.
DNS indicates dns info in SAN.
Email is type name for email.
IP indicates ip info in SAN.
Locality is type name for locality.
NewSessionDefaultRetryCnt is the default retry times when create new session.
NewSessionRetryUnlimited is the unlimited retry times when create new session.
Organization is type name for organization.
OrganizationalUnit is type name for organizational unit.
Province is type name for province or state.
RetryInterval indicates retry interval.
SyntaxErrorPrefix is the common prefix for SQL syntax error in TiDB.
URI indicates uri info in SAN.
# Variables
Version information.
ClusterTableInstanceColumnName is the `INSTANCE` column name of the cluster table.
GetSequenceByName could be used in expression package without import cycle problem.
Version information.
Version information.
InformationSchemaName is the `INFORMATION_SCHEMA` database name.
MetricSchemaName is the `METRICS_SCHEMA` database name.
PerformanceSchemaName is the `PERFORMANCE_SCHEMA` database name.
SupportCipher maintains cipher supported by TiDB.
Version information.
# Structs
ErrorGroupWithRecover will recover panic from error group.
IDGenerator util class used for generate auto-increasing id.
OOMAlarmVariablesInfo is a struct for OOM alarm variables.
ProcessInfo is a struct used for show processlist statement.
TCPConnWithIOCounter is a wrapper of net.TCPConn with counter that accumulates the bytes this connection reads/writes.
TLS saves some information about tls.
Token is used as a permission to keep on running.
TokenLimiter is used to limit the number of concurrent tasks.
WaitGroupEnhancedWrapper wrapper wg, it provides the basic ability of WaitGroupWrapper with checking unexited process if the `exited` signal is true by print them on log.
WaitGroupPool is a wrapper for sync.WaitGroup and support goroutine pool.
WaitGroupWrapper is a wrapper for sync.WaitGroup.
Worker identified by ID.
WorkerPool contains a pool of workers.
# Interfaces
SequenceTable is implemented by tableCommon, and it is specialised in handling sequence operation.
SessionManager is an interface for session manage.
SessionPool is a recyclable resource pool for the session.
# Type aliases
SANType is enum value for GlobalPrivValue.SANs keys.
TLSConfigOption is used to build a tls.Config in NewTLSConfig.