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 ¶
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
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.