Documentation ¶
Index ¶
- Constants
- type FilesGenerator
- type FilesGeneratorDomain
- func (c *FilesGeneratorDomain) CreateConfigFilesGroupCommon(configSections map[string]string, options *FilesGeneratorOptions)
- func (c *FilesGeneratorDomain) CreateConfigFilesGroupHost(configSections map[string]string, options *FilesGeneratorOptions)
- func (c *FilesGeneratorDomain) CreateConfigFilesGroupUsers(configSections map[string]string)
- type FilesGeneratorOptions
- type Generator
- type GeneratorOptions
- type IConfigGeneratorGeneric
- type IFilesGeneratorDomain
Constants ¶
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 )
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" )
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 (o *FilesGeneratorOptions) SetHost(host *api.Host) *FilesGeneratorOptions
func (*FilesGeneratorOptions) SetRaftOptions ¶
func (o *FilesGeneratorOptions) SetRaftOptions(opts *config.HostSelector) *FilesGeneratorOptions
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 ¶
GetGlobalSettings creates data for global section of "settings.xml"
func (*Generator) GetHostSettings ¶
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 IConfigGeneratorGeneric ¶
type IFilesGeneratorDomain ¶
type IFilesGeneratorDomain interface { CreateConfigFilesGroupCommon(configSections map[string]string, options *FilesGeneratorOptions) CreateConfigFilesGroupUsers(configSections map[string]string) CreateConfigFilesGroupHost(configSections map[string]string, options *FilesGeneratorOptions) }