pool

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll

func CloseAll()

CloseAll closed all connection and destroys the pool

func FreeClusterConn added in v1.5.2

func FreeClusterConn()

func InitClusterConn added in v1.5.2

func InitClusterConn(hosts [][]string, port int, db, username, password, dsnParams string, secure, skipVerify bool, maxOpenConns int) (err error)

func NumShard added in v1.5.2

func NumShard() (cnt int)

Types

type ShardConn added in v1.5.2

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

ShardConn a datastructure for storing the clickhouse connection

func GetShardConn added in v1.5.2

func GetShardConn(batchNum int64) (sc *ShardConn)

GetShardConn select a clickhouse shard based on batchNum

func (*ShardConn) Close added in v1.5.2

func (sc *ShardConn) Close()

Close closes the current replica connection

func (*ShardConn) GetDsn added in v1.9.0

func (sc *ShardConn) GetDsn() string

Close closes the current replica connection

func (*ShardConn) NextGoodReplica added in v1.5.2

func (sc *ShardConn) NextGoodReplica(failedVer int) (db *sql.DB, dbVer int, err error)

NextGoodReplica connects to next good replica

Jump to

Keyboard shortcuts

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