Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Clickhouse config #6622

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions pkg/clickhouse/config/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2025 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package clickhouse

// Configuration is clickhouse's internal configuration data
type Configuration struct {
Connection Connection `mapstructure:"connection"`
}

type Connection struct {
// Servers contains a list of hosts that are used to connect to the cluster.
Servers []string `mapstructure:"servers" valid:"required,url"`
// Database is the database name for Jaeger service on the server
Database string `mapstructure:"database_name"`
// The port used when dialing to a cluster.
Port int `mapstructure:"port"`
// Authenticator contains the details of the authentication mechanism that is used for
// connecting to a cluster.
Authenticator Authenticator `mapstructure:"auth"`
}

// Authenticator holds the authentication properties needed to connect to a Clickhouse cluster.
type Authenticator struct {
Basic BasicAuthenticator `mapstructure:"basic"`
}

// BasicAuthenticator holds the username and password for a password authenticator for a Clickhouse cluster.
type BasicAuthenticator struct {
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
}

func DefaultConfiguration() *Configuration {
return &Configuration{
Connection: Connection{
Servers: []string{"127.0.0.1"},
Port: 9000,
},
}

Check warning on line 40 in pkg/clickhouse/config/config.go

View check run for this annotation

Codecov / codecov/patch

pkg/clickhouse/config/config.go#L34-L40

Added lines #L34 - L40 were not covered by tests
}
4 changes: 4 additions & 0 deletions pkg/clickhouse/config/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) 2025 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package clickhouse
Loading