Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
Each shard has a clickhouse.Conn which connects to one replica inside the shard. We need more control than replica single-point-failure.
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
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) GetReplica ¶ added in v1.5.2
GetReplica returns the replica to which db connects
Click to show internal directories.
Click to hide internal directories.