tidb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNS           = errorx.NewNamespace("error.tidb")
	ErrPDAccessFailed = ErrorNS.NewType("pd_access_failed")
	ErrNoAliveTiDB    = ErrorNS.NewType("no_alive_tidb")
	ErrTiDBConnFailed = ErrorNS.NewType("tidb_conn_failed")
	ErrTiDBAuthFailed = ErrorNS.NewType("tidb_auth_failed")
)

Functions

This section is empty.

Types

type Forwarder

type Forwarder struct {
	// contains filtered or unexported fields
}

func NewForwarder

func NewForwarder(config *ForwarderConfig, etcdProvider pd.EtcdProvider) *Forwarder

func (*Forwarder) Close

func (f *Forwarder) Close() error

func (*Forwarder) GetDBConnProps

func (f *Forwarder) GetDBConnProps() (host string, port int, err error)

func (*Forwarder) Open

func (f *Forwarder) Open() error

TODO: Requires load balancing and health checks.

func (*Forwarder) OpenTiDB

func (f *Forwarder) OpenTiDB(user string, pass string) (*gorm.DB, error)

type ForwarderConfig

type ForwarderConfig struct {
	TiDBRetrieveTimeout time.Duration
	TLSConfig           *tls.Config
}

func NewForwarderConfig

func NewForwarderConfig(tlsConfig *tls.Config) *ForwarderConfig

Jump to

Keyboard shortcuts

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