Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) GetCDCAvg(ctx context.Context) (string, error)
- func (c *Config) GetCDCEnabled(ctx context.Context) (string, error)
- func (c *Config) GetCDCMax(ctx context.Context) (string, error)
- func (c *Config) GetCDCMin(ctx context.Context) (string, error)
- func (c *Config) GetClusterUUID(ctx context.Context) (string, error)
- func (c *Config) GetSecretKey(ctx context.Context) (string, error)
- func (c *Config) SetCDCAvg(ctx context.Context, value string) error
- func (c *Config) SetCDCEnabled(ctx context.Context, value string) error
- func (c *Config) SetCDCMax(ctx context.Context, value string) error
- func (c *Config) SetCDCMin(ctx context.Context, value string) error
- func (c *Config) SetClusterUUID(ctx context.Context, value string) error
- func (c *Config) SetSecretKey(ctx context.Context, value string) error
- func (c *Config) ValidateOrStoreCDCConfig(ctx context.Context, enabled bool, minSize, avgSize, maxSize uint32) error
Constants ¶
const ( // KeyClusterUUID is the key for the cluster UUID in the configuration database. KeyClusterUUID = "cluster_uuid" // KeySecretKey is the key for the secret key in the configuration database. KeySecretKey = "secret_key" // KeyCDCEnabled is the key for CDC enabled flag in the configuration database. KeyCDCEnabled = "cdc_enabled" // KeyCDCMin is the key for CDC minimum chunk size in the configuration database. KeyCDCMin = "cdc_min" // KeyCDCAvg is the key for CDC average chunk size in the configuration database. KeyCDCAvg = "cdc_avg" // KeyCDCMax is the key for CDC maximum chunk size in the configuration database. KeyCDCMax = "cdc_max" )
Variables ¶
var ( // ErrConfigNotFound is returned if no config with this key was found. ErrConfigNotFound = errors.New("no config was found for this key") // ErrCDCDisabledAfterEnabled is returned when attempting to disable CDC after being enabled. ErrCDCDisabledAfterEnabled = errors.New( "CDC cannot be disabled after being enabled; existing chunked NARs would not be reconstructed", ) // ErrCDCConfigMismatch is returned when CDC configuration values differ from stored values. ErrCDCConfigMismatch = errors.New( "CDC config changed; different chunk sizes create new chunks without reusing old ones, causing storage duplication", ) // ErrCDCInvalidChunkSizes is returned when CDC chunk sizes are zero or invalid. ErrCDCInvalidChunkSizes = errors.New( "CDC chunk sizes must be non-zero when CDC is enabled", ) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides access to the persistent configuration stored in the database. It uses an RWLocker to ensure thread-safe access to configuration keys.
func (*Config) GetCDCAvg ¶ added in v0.9.2
GetCDCAvg returns the CDC average chunk size from the configuration.
func (*Config) GetCDCEnabled ¶ added in v0.9.2
GetCDCEnabled returns the CDC enabled flag from the configuration.
func (*Config) GetCDCMax ¶ added in v0.9.2
GetCDCMax returns the CDC maximum chunk size from the configuration.
func (*Config) GetCDCMin ¶ added in v0.9.2
GetCDCMin returns the CDC minimum chunk size from the configuration.
func (*Config) GetClusterUUID ¶
GetClusterUUID returns the cluster UUID from the configuration.
func (*Config) GetSecretKey ¶ added in v0.7.0
GetSecretKey returns the secret key from the configuration.
func (*Config) SetCDCAvg ¶ added in v0.9.2
SetCDCAvg stores the CDC average chunk size in the configuration.
func (*Config) SetCDCEnabled ¶ added in v0.9.2
SetCDCEnabled stores the CDC enabled flag in the configuration.
func (*Config) SetCDCMax ¶ added in v0.9.2
SetCDCMax stores the CDC maximum chunk size in the configuration.
func (*Config) SetCDCMin ¶ added in v0.9.2
SetCDCMin stores the CDC minimum chunk size in the configuration.
func (*Config) SetClusterUUID ¶
SetClusterUUID stores the cluster UUID in the configuration.
func (*Config) SetSecretKey ¶ added in v0.7.0
SetSecretKey stores the secret key in the configuration.
func (*Config) ValidateOrStoreCDCConfig ¶ added in v0.9.2
func (c *Config) ValidateOrStoreCDCConfig( ctx context.Context, enabled bool, minSize, avgSize, maxSize uint32, ) error
ValidateOrStoreCDCConfig validates CDC configuration against stored values or stores them if not yet configured. If CDC is disabled and no config exists, returns nil (no-op). If CDC is enabled and no config exists, stores all 4 values. If config exists, validates that enabled flag matches and all values are identical. If CDC was previously enabled (config exists) but now disabled, returns an error.