config

package
v0.0.0-...-d7e1125 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CommonConfigDir specifies folder's name, where generated common XML files for ClickHouse would be placed
	CommonConfigDir = api.CommonConfigDirKeeper

	// UsersConfigDir specifies folder's name, where generated users XML files for ClickHouse would be placed
	UsersConfigDir = api.UsersConfigDirKeeper

	// HostConfigDir specifies folder's name, where generated host XML files for ClickHouse would be placed
	HostConfigDir = api.HostConfigDirKeeper

	// TemplatesDir specifies folder's name where ClickHouseInstallationTemplates are located
	TemplatesDir = api.TemplatesDirKeeper
)
View Source
const (
	DirPathConfigRoot = "/etc/clickhouse-keeper"

	// DirPathConfigCommon specifies full path to folder,
	// where generated common XML files for the following sections would be placed:
	// 1. remote servers
	// 2. operator-provided additional config files
	DirPathConfigCommon = DirPathConfigRoot + "/" + CommonConfigDir + "/"

	// DirPathConfigUsers specifies full path to folder, where generated users XML files would be placed
	// for the following sections:
	// 1. users
	// 2. quotas
	// 3. profiles
	// 4. operator-provided additional config files
	DirPathConfigUsers = DirPathConfigRoot + "/" + UsersConfigDir + "/"

	// DirPathConfigHost specifies full path to folder, where generated host XML files would be placed
	// for the following sections:
	// 1. macros
	// 2. zookeeper
	// 3. settings
	// 4. files
	// 5. operator-provided additional config files
	DirPathConfigHost = DirPathConfigRoot + "/" + HostConfigDir + "/"

	// DirPathDataStorage specifies full path of data folder where ClickHouse would place its data storage
	DirPathDataStorage = "/var/lib/clickhouse-keeper"

	// DirPathLogStorage  specifies full path of data folder where ClickHouse would place its log files
	DirPathLogStorage = "/var/log/clickhouse-keeper-log"
)
View Source
const (
	// DefaultKeeperDockerImage specifies default ClickHouse docker image to be used
	DefaultKeeperDockerImage = "clickhouse/clickhouse-keeper:latest"

	// KeeperContainerName specifies name of the clickhouse container in the pod
	KeeperContainerName = "clickhouse-keeper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesGenerator

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

FilesGenerator specifies configuration generator object

func NewFilesGenerator

func NewFilesGenerator(
	configGeneratorGeneric IConfigGeneratorGeneric,
	pathsGetter chi.IOperatorConfigFilesPathsGetter,
	configFilesGeneratorDomain IFilesGeneratorDomain,
) *FilesGenerator

NewFilesGenerator creates new configuration files generator object

func (*FilesGenerator) CreateConfigFiles

func (c *FilesGenerator) CreateConfigFiles(what interfaces.FilesGroupType, params ...any) map[string]string

type FilesGeneratorDomain

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

FilesGenerator specifies configuration generator object

func NewFilesGeneratorDomain

func NewFilesGeneratorDomain(configGenerator *Generator) *FilesGeneratorDomain

NewFilesGenerator creates new configuration files generator object

func (*FilesGeneratorDomain) CreateConfigFilesGroupCommon

func (c *FilesGeneratorDomain) CreateConfigFilesGroupCommon(configSections map[string]string, options *FilesGeneratorOptions)

func (*FilesGeneratorDomain) CreateConfigFilesGroupHost

func (c *FilesGeneratorDomain) CreateConfigFilesGroupHost(configSections map[string]string, options *FilesGeneratorOptions)

func (*FilesGeneratorDomain) CreateConfigFilesGroupUsers

func (c *FilesGeneratorDomain) CreateConfigFilesGroupUsers(configSections map[string]string)

type FilesGeneratorOptions

type FilesGeneratorOptions struct {
	RaftOptions *config.HostSelector
	// contains filtered or unexported fields
}

FilesGeneratorOptions specifies options for configuration files generator

func NewFilesGeneratorOptions

func NewFilesGeneratorOptions() *FilesGeneratorOptions

NewFilesGeneratorOptions creates new options for configuration files generator

func (*FilesGeneratorOptions) GetHost

func (o *FilesGeneratorOptions) GetHost() *api.Host

func (*FilesGeneratorOptions) GetRaftOptions

func (o *FilesGeneratorOptions) GetRaftOptions() *config.HostSelector

GetRaftOptions gets RAFT generator options

func (*FilesGeneratorOptions) SetHost

func (*FilesGeneratorOptions) SetRaftOptions

SetRaftOptions sets RAFT generator options

type Generator

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

Generator generates configuration files content for specified CR Configuration files content is an XML ATM, so config generator provides set of Get*() functions which produces XML which are parts of configuration and can/should be used as content of config files.

func NewGenerator

func NewGenerator(cr chi.ICustomResource, namer interfaces.INameManager, opts *GeneratorOptions) *Generator

NewGenerator returns new Generator struct

func (*Generator) GetGlobalSettings

func (c *Generator) GetGlobalSettings() string

GetGlobalSettings creates data for global section of "settings.xml"

func (*Generator) GetHostSettings

func (c *Generator) GetHostSettings(host *chi.Host) string

GetHostSettings creates data for host section of "settings.xml"

func (*Generator) GetSectionFromFiles

func (c *Generator) GetSectionFromFiles(section chi.SettingsSection, includeUnspecified bool, host *chi.Host) map[string]string

GetSectionFromFiles creates data for custom common config files

type GeneratorOptions

type GeneratorOptions struct {
	Settings *api.Settings
	Files    *api.Settings
}

type IConfigGeneratorGeneric

type IConfigGeneratorGeneric interface {
	GetGlobalSettings() string
	GetSectionFromFiles(section chi.SettingsSection, includeUnspecified bool, host *chi.Host) map[string]string
	GetHostSettings(host *chi.Host) string
}

type IFilesGeneratorDomain

type IFilesGeneratorDomain interface {
	CreateConfigFilesGroupCommon(configSections map[string]string, options *FilesGeneratorOptions)
	CreateConfigFilesGroupUsers(configSections map[string]string)
	CreateConfigFilesGroupHost(configSections map[string]string, options *FilesGeneratorOptions)
}

Jump to

Keyboard shortcuts

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