Documentation ¶
Index ¶
- Constants
- func FromCluster(cluster *v1alpha1.GreptimeDBCluster, componentKind v1alpha1.ComponentKind) ([]byte, error)
- func FromStandalone(standalone *v1alpha1.GreptimeDBStandalone) ([]byte, error)
- func Marshal(config Config) ([]byte, error)
- type Config
- type DatanodeConfig
- func (c *DatanodeConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
- func (c *DatanodeConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
- func (c *DatanodeConfig) GetInputConfig() string
- func (c *DatanodeConfig) Kind() v1alpha1.ComponentKind
- func (c *DatanodeConfig) SetInputConfig(input string) error
- type FlownodeConfig
- func (c *FlownodeConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
- func (c *FlownodeConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
- func (c *FlownodeConfig) GetInputConfig() string
- func (c *FlownodeConfig) Kind() v1alpha1.ComponentKind
- func (c *FlownodeConfig) SetInputConfig(input string) error
- type FrontendConfig
- func (c *FrontendConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
- func (c *FrontendConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
- func (c *FrontendConfig) GetInputConfig() string
- func (c *FrontendConfig) Kind() v1alpha1.ComponentKind
- func (c *FrontendConfig) SetInputConfig(inputConfig string) error
- type LoggingConfig
- type MetaConfig
- func (c *MetaConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
- func (c *MetaConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
- func (c *MetaConfig) GetInputConfig() string
- func (c *MetaConfig) Kind() v1alpha1.ComponentKind
- func (c *MetaConfig) SetInputConfig(inputConfig string) error
- type StandaloneConfig
- func (c *StandaloneConfig) ConfigureByCluster(_ *v1alpha1.GreptimeDBCluster) error
- func (c *StandaloneConfig) ConfigureByStandalone(standalone *v1alpha1.GreptimeDBStandalone) error
- func (c *StandaloneConfig) GetInputConfig() string
- func (c *StandaloneConfig) Kind() v1alpha1.ComponentKind
- func (c *StandaloneConfig) SetInputConfig(inputConfig string) error
- type StorageConfig
- type WALConfig
Constants ¶
const ( // TOMLMappingFieldTag is the special tag for the field in the config struct. // The value of the tag is the key in the toml. TOMLMappingFieldTag = "tomlmapping" // InlinedFieldTag indicates the field should be inlined. InlinedFieldTag = ",inline" )
Variables ¶
This section is empty.
Functions ¶
func FromCluster ¶
func FromCluster(cluster *v1alpha1.GreptimeDBCluster, componentKind v1alpha1.ComponentKind) ([]byte, error)
FromCluster creates config data from the cluster CRD.
func FromStandalone ¶
func FromStandalone(standalone *v1alpha1.GreptimeDBStandalone) ([]byte, error)
FromStandalone creates config data from the standalone CRD.
Types ¶
type Config ¶
type Config interface { // Kind returns the component kind of the config. Kind() v1alpha1.ComponentKind // ConfigureByCluster configures the config by the given cluster. ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error // ConfigureByStandalone configures the config by the given standalone. ConfigureByStandalone(standalone *v1alpha1.GreptimeDBStandalone) error // GetInputConfig returns the input config. GetInputConfig() string // SetInputConfig sets the input config. SetInputConfig(input string) error }
Config is the interface for the config of greptimedb.
func NewFromComponentKind ¶
func NewFromComponentKind(kind v1alpha1.ComponentKind) (Config, error)
NewFromComponentKind creates config from the component kind.
type DatanodeConfig ¶
type DatanodeConfig struct { NodeID *uint64 `tomlmapping:"node_id"` RPCAddr *string `tomlmapping:"rpc_addr"` RPCHostName *string `tomlmapping:"rpc_hostname"` // StorageConfig is the configuration for the storage. StorageConfig `tomlmapping:",inline"` // WALConfig is the configuration for the WAL. WALConfig `tomlmapping:",inline"` // LoggingConfig is the configuration for the logging. LoggingConfig `tomlmapping:",inline"` // InputConfig is from config field of cluster spec. InputConfig string }
DatanodeConfig is the configuration for the datanode.
func (*DatanodeConfig) ConfigureByCluster ¶
func (c *DatanodeConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
ConfigureByCluster configures the datanode config by the given cluster.
func (*DatanodeConfig) ConfigureByStandalone ¶
func (c *DatanodeConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
ConfigureByStandalone is not need to implement in cluster mode.
func (*DatanodeConfig) GetInputConfig ¶
func (c *DatanodeConfig) GetInputConfig() string
GetInputConfig returns the input config.
func (*DatanodeConfig) Kind ¶
func (c *DatanodeConfig) Kind() v1alpha1.ComponentKind
Kind returns the component kind of the datanode.
func (*DatanodeConfig) SetInputConfig ¶
func (c *DatanodeConfig) SetInputConfig(input string) error
SetInputConfig sets the input config.
type FlownodeConfig ¶
type FlownodeConfig struct { NodeID *uint64 `tomlmapping:"node_id"` Addr *string `tomlmapping:"grpc.addr"` Hostname *string `tomlmapping:"grpc.hostname"` // LoggingConfig is the configuration for the logging. LoggingConfig `tomlmapping:",inline"` // InputConfig is from config field of cluster spec. InputConfig string }
FlownodeConfig is the configuration for the datanode.
func (*FlownodeConfig) ConfigureByCluster ¶
func (c *FlownodeConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
ConfigureByCluster configures the datanode config by the given cluster.
func (*FlownodeConfig) ConfigureByStandalone ¶
func (c *FlownodeConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
ConfigureByStandalone is not need to implement in cluster mode.
func (*FlownodeConfig) GetInputConfig ¶
func (c *FlownodeConfig) GetInputConfig() string
GetInputConfig returns the input config.
func (*FlownodeConfig) Kind ¶
func (c *FlownodeConfig) Kind() v1alpha1.ComponentKind
Kind returns the component kind of the datanode.
func (*FlownodeConfig) SetInputConfig ¶
func (c *FlownodeConfig) SetInputConfig(input string) error
SetInputConfig sets the input config.
type FrontendConfig ¶
type FrontendConfig struct { // LoggingConfig is the configuration for the logging. LoggingConfig `tomlmapping:",inline"` // InputConfig is from config field of cluster spec. InputConfig string }
FrontendConfig is the configuration for the frontend.
func (*FrontendConfig) ConfigureByCluster ¶
func (c *FrontendConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
ConfigureByCluster configures the frontend configuration by the given cluster.
func (*FrontendConfig) ConfigureByStandalone ¶
func (c *FrontendConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
ConfigureByStandalone is not need to implement in cluster mode.
func (*FrontendConfig) GetInputConfig ¶
func (c *FrontendConfig) GetInputConfig() string
GetInputConfig returns the input config of the frontend.
func (*FrontendConfig) Kind ¶
func (c *FrontendConfig) Kind() v1alpha1.ComponentKind
Kind returns the component kind of the frontend.
func (*FrontendConfig) SetInputConfig ¶
func (c *FrontendConfig) SetInputConfig(inputConfig string) error
SetInputConfig sets the input config of the frontend.
type LoggingConfig ¶
type LoggingConfig struct { // The directory to store the log files. If set to empty, logs will not be written to files. Dir *string `tomlmapping:"logging.dir"` // The log level. Can be `info`/`debug`/`warn`/`error`. Level *string `tomlmapping:"logging.level"` // The log format. Can be `text`/`json`. LogFormat *string `tomlmapping:"logging.log_format"` }
LoggingConfig is the configuration for the logging.
func (*LoggingConfig) ConfigureLogging ¶
func (c *LoggingConfig) ConfigureLogging(global *v1alpha1.LoggingSpec, component *v1alpha1.LoggingSpec)
ConfigureLogging configures the logging config with the given logging spec.
type MetaConfig ¶
type MetaConfig struct { // Enable region failover. EnableRegionFailover *bool `tomlmapping:"enable_region_failover"` // If it's not empty, the meta will store all data with this key prefix. StoreKeyPrefix *string `tomlmapping:"store_key_prefix"` // The wal provider. WalProvider *string `tomlmapping:"wal.provider"` // The kafka broker endpoints. WalBrokerEndpoints []string `tomlmapping:"wal.broker_endpoints"` // LoggingConfig is the configuration for the logging. LoggingConfig `tomlmapping:",inline"` // InputConfig is from config field of cluster spec. InputConfig string }
MetaConfig is the configuration for the meta.
func (*MetaConfig) ConfigureByCluster ¶
func (c *MetaConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error
ConfigureByCluster configures the meta config by the given cluster.
func (*MetaConfig) ConfigureByStandalone ¶
func (c *MetaConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error
ConfigureByStandalone is not need to implement in cluster mode.
func (*MetaConfig) GetInputConfig ¶
func (c *MetaConfig) GetInputConfig() string
GetInputConfig returns the input config of the meta.
func (*MetaConfig) Kind ¶
func (c *MetaConfig) Kind() v1alpha1.ComponentKind
Kind returns the component kind of the meta.
func (*MetaConfig) SetInputConfig ¶
func (c *MetaConfig) SetInputConfig(inputConfig string) error
SetInputConfig sets the input config of the meta.
type StandaloneConfig ¶
type StandaloneConfig struct { // StorageConfig is the configuration for the storage. StorageConfig `tomlmapping:",inline"` // WALConfig is the configuration for the WAL. WALConfig `tomlmapping:",inline"` // LoggingConfig is the configuration for the logging. LoggingConfig `tomlmapping:",inline"` // InputConfig is from config field of cluster spec. InputConfig string }
StandaloneConfig is the configuration for the frontend.
func (*StandaloneConfig) ConfigureByCluster ¶
func (c *StandaloneConfig) ConfigureByCluster(_ *v1alpha1.GreptimeDBCluster) error
ConfigureByCluster is not need to implement in standalone mode.
func (*StandaloneConfig) ConfigureByStandalone ¶
func (c *StandaloneConfig) ConfigureByStandalone(standalone *v1alpha1.GreptimeDBStandalone) error
ConfigureByStandalone is not need to implement in cluster mode.
func (*StandaloneConfig) GetInputConfig ¶
func (c *StandaloneConfig) GetInputConfig() string
GetInputConfig returns the input config of the standalone.
func (*StandaloneConfig) Kind ¶
func (c *StandaloneConfig) Kind() v1alpha1.ComponentKind
Kind returns the component kind of the standalone.
func (*StandaloneConfig) SetInputConfig ¶
func (c *StandaloneConfig) SetInputConfig(inputConfig string) error
SetInputConfig sets the input config of the standalone.
type StorageConfig ¶
type StorageConfig struct { StorageType *string `tomlmapping:"storage.type"` StorageDataHome *string `tomlmapping:"storage.data_home"` StorageAccessKeyID *string `tomlmapping:"storage.access_key_id"` StorageSecretAccessKey *string `tomlmapping:"storage.secret_access_key"` StorageAccessKeySecret *string `tomlmapping:"storage.access_key_secret"` StorageBucket *string `tomlmapping:"storage.bucket"` StorageRoot *string `tomlmapping:"storage.root"` StorageRegion *string `tomlmapping:"storage.region"` StorageEndpoint *string `tomlmapping:"storage.endpoint"` StorageScope *string `tomlmapping:"storage.scope"` StorageCredential *string `tomlmapping:"storage.credential"` }
StorageConfig is the configuration for the storage.
func (*StorageConfig) ConfigureObjectStorage ¶
func (c *StorageConfig) ConfigureObjectStorage(namespace string, accessor v1alpha1.ObjectStorageProviderAccessor) error
ConfigureObjectStorage configures the storage config by the given object storage provider accessor.
type WALConfig ¶
type WALConfig struct { // The wal file directory. WalDir *string `tomlmapping:"wal.dir"` // The wal provider. WalProvider *string `tomlmapping:"wal.provider"` // The kafka broker endpoints. WalBrokerEndpoints []string `tomlmapping:"wal.broker_endpoints"` }
WALConfig is the configuration for the WAL.