clickhouse

package
v2.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *Config) *query.QueryDb

New 新连接

Types

type Config

type Config struct {
	Username     string //账号 root
	Password     string //密码
	Host         string //host localhost
	Port         string //端口 3306
	Database     string //默认连接数据库
	ReadTimeout  int
	WriteTimeout int
	LoadBalance  string //负载均衡
	DriverName   string
	Trace        bool
}

Config 数据库配置

func (*Config) URI

func (config *Config) URI() string

URI 构造数据库连接

type Proxy

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

Proxy 代理

func NewProxy

func NewProxy() *Proxy

NewProxy 代理池

func (*Proxy) Read

func (proxy *Proxy) Read() *query.QueryDb

Read 获取读库

func (*Proxy) SetRead

func (proxy *Proxy) SetRead(query *query.QueryDb)

SetRead 设置读库

func (*Proxy) SetWrite

func (proxy *Proxy) SetWrite(query *query.QueryDb)

SetWrite 设置写库

func (*Proxy) Write

func (proxy *Proxy) Write() *query.QueryDb

Write 获取写库

type ProxyPool

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

ProxyPool 代理池

func NewProxyPool

func NewProxyPool() *ProxyPool

NewProxyPool 代理池

func (*ProxyPool) NameSpace

func (proxypool *ProxyPool) NameSpace(group string) *Proxy

NameSpace 获取分组

func (*ProxyPool) SetNameSpace

func (proxypool *ProxyPool) SetNameSpace(group string, proxy *Proxy)

SetNameSpace 设置组

Jump to

Keyboard shortcuts

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