tidbclient

package
v0.0.0-...-08b9edc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tidbclient provides a flexible TiDB API access to any TiDB instance.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNS = errorx.NewNamespace("tidb_client")
	// ErrAuthFailed means the authentication is failed when connecting to the TiDB Server
	ErrAuthFailed = ErrNS.NewType("tidb_auth_failed")
	// ErrConnFailed means there is a connection (like network) problem when connecting to the TiDB Server
	ErrConnFailed = ErrNS.NewType("tidb_conn_failed")
)

Functions

This section is empty.

Types

type SQLClient

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

func NewSQLClient

func NewSQLClient(config SQLClientConfig) *SQLClient

func (*SQLClient) OpenConn

func (c *SQLClient) OpenConn(user string, pass string) (*gorm.DB, error)

OpenConn opens a new connection. NOTICE: The opened connection must be manually closed.

type SQLClientConfig

type SQLClientConfig struct {
	BaseContext context.Context
	Host        string
	Port        int
	TLSKey      string
}

type StatusClient

type StatusClient struct {
	*httpclient.Client
}

func NewStatusClient

func NewStatusClient(config httpclient.APIClientConfig) (*StatusClient, error)

Returns error when config is invalid.

Directories

Path Synopsis
Package tidbproxy provides a TiDB cluster proxy service.
Package tidbproxy provides a TiDB cluster proxy service.

Jump to

Keyboard shortcuts

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