container

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package container provides a set of functions to interact with ClickHouse containers.

Index

Constants

View Source
const (

	// SecureNativePort is the secure port for the ClickHouse container.
	SecureNativePort = nat.Port("9440/tcp")
)

Variables

This section is empty.

Functions

func WithCerts

func WithCerts(caCert, clientCerts *tlscert.Certificate) testcontainers.CustomizeRequestOption

WithCerts is a customize request option that adds the certificates to the clickhouse container.

Types

type Container

type Container struct {
	*chmodule.ClickHouseContainer
	// contains filtered or unexported fields
}

Container is a struct that holds the clickhouse and zookeeper containers.

func CreateClickHouseContainer

func CreateClickHouseContainer(ctx context.Context, settings config.Settings) (*Container, error)

CreateClickHouseContainer function starts and testcontainer for clickhouse. The caller is responsible for terminating the container.

func (*Container) Config

func (c *Container) Config() config.Settings

Config returns the settings of the container.

func (*Container) GetClickHouseAsConn

func (c *Container) GetClickHouseAsConn() (clickhouse.Conn, error)

GetClickHouseAsConn function returns a clickhouse.Conn connection which uses native ClickHouse protocol.

func (*Container) GetClickhouseAsDB

func (c *Container) GetClickhouseAsDB() (*sql.DB, error)

GetClickhouseAsDB function returns a sql.DB connection which allows interfaceing with the stdlib database/sql package.

func (*Container) Terminate

func (c *Container) Terminate(ctx context.Context)

Terminate function terminates the clickhouse containers. If an error occurs, it will be printed to stderr.

Jump to

Keyboard shortcuts

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