cluster

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cluster implements ClickHouse Cluster layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster of ClickHouse.

func Connect

func Connect(ctx context.Context, opts ConnectOptions) (*Cluster, error)

Connect returns new Cluster

func NewCluster

func NewCluster(shards []Shard) *Cluster

NewCluster returns new Cluster.

func (*Cluster) Close

func (c *Cluster) Close() (err error)

Close Cluster.

func (*Cluster) ExecOnCluster

func (c *Cluster) ExecOnCluster(ctx context.Context, query string, args ...string) error

ExecOnCluster executes query on all shards.

func (*Cluster) GetShards

func (c *Cluster) GetShards() []Shard

GetShards returns shards.

type ConnectOptions

type ConnectOptions struct {
	Address     string
	Username    string
	Password    string
	ClusterName string
}

ConnectOptions ...

type Shard

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

Shard ...

func NewShard

func NewShard(name string, conn clickhouse.Conn) Shard

NewShard returns new Shard.

func (*Shard) Exec

func (c *Shard) Exec(ctx context.Context, query string, args ...any) error

Exec ...

func (*Shard) Query

func (c *Shard) Query(ctx context.Context, query string, args ...any) (driver.Rows, error)

Query ...

func (*Shard) QueryRow

func (c *Shard) QueryRow(ctx context.Context, query string, args ...any) driver.Row

QueryRow ...

Jump to

Keyboard shortcuts

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