clickhouse

package
v0.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HTTPPort = nat.Port("8123/tcp")
View Source
const NativePort = nat.Port("9000/tcp")

Variables

This section is empty.

Functions

func WithConfigFile

func WithConfigFile(configFile string) testcontainers.CustomizeRequestOption

WithConfigFile sets the XML config file to be used for the clickhouse container It will also set the "configFile" parameter to the path of the config file as a command line argument to the container.

func WithDatabase

func WithDatabase(dbName string) testcontainers.CustomizeRequestOption

WithDatabase sets the initial database to be created when the container starts It can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the default value("clickhouse") will be used.

func WithInitScripts

func WithInitScripts(scripts ...string) testcontainers.CustomizeRequestOption

WithInitScripts sets the init scripts to be run when the container starts

func WithPassword

func WithPassword(password string) testcontainers.CustomizeRequestOption

WithPassword sets the initial password of the user to be created when the container starts It is required for you to use the ClickHouse image. It must not be empty or undefined. This environment variable sets the password for ClickHouse.

func WithUsername

func WithUsername(user string) testcontainers.CustomizeRequestOption

WithUsername sets the initial username to be created when the container starts It is used in conjunction with WithPassword to set a user and its password. It will create the specified user with superuser power. If it is not specified, then the default user of clickhouse will be used.

func WithYamlConfigFile

func WithYamlConfigFile(configFile string) testcontainers.CustomizeRequestOption

WithConfigFile sets the YAML config file to be used for the clickhouse container It will also set the "configFile" parameter to the path of the config file as a command line argument to the container.

func WithZookeeper

func WithZookeeper(container *ZookeeperContainer) testcontainers.CustomizeRequestOption

Types

type ClickHouseContainer

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

ClickHouseContainer represents the ClickHouse container type used in the module

func Prepare

func Prepare(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*ClickHouseContainer, error)

Prepare creates an instance of the ClickHouse container type

func (*ClickHouseContainer) ConnectionHost

func (c *ClickHouseContainer) ConnectionHost(ctx context.Context) (string, error)

func (*ClickHouseContainer) ConnectionString

func (c *ClickHouseContainer) ConnectionString(ctx context.Context, args ...string) (string, error)

ConnectionString returns the dsn string for the clickhouse container, using the default 9000 port, and obtaining the host and exposed port from the container. It also accepts a variadic list of extra arguments which will be appended to the dsn string. The format of the extra arguments is the same as the connection string format, e.g. "dial_timeout=300ms" or "skip_verify=false"

type ZookeeperContainer

type ZookeeperContainer struct {
	testcontainers.Container
	// contains filtered or unexported fields
}

ClickHouseContainer represents the ClickHouse container type used in the module

func PrepareZK

func PrepareZK(ctx context.Context) (*ZookeeperContainer, error)

func (*ZookeeperContainer) IP

func (c *ZookeeperContainer) IP() string

func (*ZookeeperContainer) Port

func (c *ZookeeperContainer) Port() nat.Port

Jump to

Keyboard shortcuts

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