clickhouse

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDBTestClient

func MakeDBTestClient(ctx context.Context, config common.TestClientConfig) (*sql.DB, error)

MakeDBTestClient returns ClickHouse HTTP Server client used in tests.

func MakeNativeTestClient

func MakeNativeTestClient(ctx context.Context, config common.TestClientConfig) (*ch.Client, error)

MakeNativeTestClient returns ClickHouse Native Server client used in tests.

func NewEngine

func NewEngine(ec common.EngineConfig) common.Engine

Types

type Engine

type Engine struct {
	common.EngineConfig
	// contains filtered or unexported fields
}

func (*Engine) HandleConnection

func (e *Engine) HandleConnection(ctx context.Context, sessionCtx *common.Session) error

func (*Engine) InitializeConnection

func (e *Engine) InitializeConnection(clientConn net.Conn, sessionCtx *common.Session) error

func (*Engine) SendError

func (e *Engine) SendError(err error)

type TestServer

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

TestServer is a ClickHouse test server that allows to handle basic HTTP and ClickHouse Native connections.

func NewTestServer

func NewTestServer(config common.TestServerConfig, opts ...TestServerOption) (*TestServer, error)

NewTestServer returns a new instance of a test ClickHouse server.

func (*TestServer) Close

func (s *TestServer) Close() error

Close closes the server listener.

func (*TestServer) Port

func (s *TestServer) Port() string

Port returns Clickhouse Server port.

func (*TestServer) Serve

func (s *TestServer) Serve() error

type TestServerOption

type TestServerOption func(*TestServer)

TestServerOption allows setting test server options.

func WithClickHouseHTTPProtocol

func WithClickHouseHTTPProtocol() TestServerOption

WithClickHouseHTTPProtocol specify the HTTP ClickHouse Protocol for test TestServer.

func WithClickHouseNativeProtocol

func WithClickHouseNativeProtocol() TestServerOption

WithClickHouseNativeProtocol specify the Native Protocol for test TestServer.

Jump to

Keyboard shortcuts

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