clickhouse

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir returns the platform-specific default data directory.

func DownloadBinary

func DownloadBinary(dataDir string, onProgress ...func(DownloadProgress)) (string, error)

DownloadBinary downloads the ClickHouse binary to {dataDir}/bin/clickhouse. Returns the path to the downloaded binary. An optional onProgress callback is called at each percent change.

func FindBinary

func FindBinary(configured, dataDir string) string

FindBinary locates the ClickHouse binary. Search order: 1. configured path (explicit) 2. {dataDir}/bin/clickhouse 3. $PATH

Types

type DownloadProgress added in v0.8.2

type DownloadProgress struct {
	BytesDownloaded int64
	TotalBytes      int64
	Percent         int
}

DownloadProgress reports the state of the binary download.

type ManagedServer

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

ManagedServer manages a ClickHouse subprocess.

func NewManagedServer

func NewManagedServer(dataDir string) *ManagedServer

NewManagedServer creates a new managed ClickHouse server configuration.

func (*ManagedServer) DataDir

func (m *ManagedServer) DataDir() string

DataDir returns the data directory path.

func (*ManagedServer) HTTPPort

func (m *ManagedServer) HTTPPort() int

HTTPPort returns the HTTP port.

func (*ManagedServer) Restart

func (m *ManagedServer) Restart(ctx context.Context) error

Restart stops and restarts the managed ClickHouse server.

func (*ManagedServer) Start

func (m *ManagedServer) Start(ctx context.Context, binaryPath string) error

Start launches the ClickHouse server process and waits for it to become ready.

func (*ManagedServer) Stop

func (m *ManagedServer) Stop()

Stop gracefully stops the ClickHouse process.

func (*ManagedServer) TCPPort

func (m *ManagedServer) TCPPort() int

TCPPort returns the native TCP port.

Jump to

Keyboard shortcuts

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