Documentation
¶
Index ¶
- Constants
- Variables
- func BaseKey(k string) (baseKey string)
- func BaseVersion(ver string) (string, error)
- func ContextKey(k string) string
- func CreateSetConfigCmdList(log logr.Logger, configMap DynamicConfigMap, conn deployment.ASConnInterface, ...) ([]string, error)
- func GetASConfig(path *string, conn *deployment.ASConn, aerospikePolicy *aero.ClientPolicy) (confToReturn interface{}, err error)
- func GetDefault(ver string) (map[string]interface{}, error)
- func GetDynamic(ver string) (sets.Set[string], error)
- func GetFlatKey(tokens []string) string
- func Init(log logr.Logger, schemaDir string) error
- func InitFromMap(log logr.Logger, schemaMap map[string]string)
- func IsAllDynamicConfig(log logr.Logger, configMap DynamicConfigMap, version string) (bool, error)
- func IsDynamicConfig(log logr.Logger, dynamic sets.Set[string], conf string, ...) bool
- func IsSupportedVersion(ver string) (bool, error)
- func IsUpgrade(fromVersion, toVersion string) (bool, error)
- func IsValidUpgrade(fromVersion, toVersion string) error
- func PluralOf(noun string) string
- func SingularOf(noun string) string
- func SplitKey(log logr.Logger, key, sep string) []string
- func ToPlural(k string, v any, m Conf)
- type AsConfig
- type CfgValue
- type Conf
- type ConfGetter
- type DotConf
- type DynamicConfigMap
- type GenConf
- type GetConfigStep
- type GetFlatSchemaStep
- type Operation
- type ServerVersionCheckStep
- type ValidationErr
Constants ¶
const ( KeyName = "name" SectionNameStartChar = '{' SectionNameEndChar = '}' // Enum values for Operation Add Operation = "add" Remove Operation = "remove" Update Operation = "update" )
All the aerospike config related keys
const ( FSPATH sysproptype = "FSPATH" NETADDR sysproptype = "NETADDR" DEVICE sysproptype = "DEVICE" NONE sysproptype = "NONE" )
types of system properties
Variables ¶
var BenchmarkConfigs = []string{
"enable-benchmarks-batch-sub", "enable-benchmarks-read",
"enable-benchmarks-udf", "enable-benchmarks-write",
"enable-benchmarks-udf-sub", "enable-benchmarks-storage",
"enable-benchmarks-fabric", "enable-benchmarks-ops-sub",
}
var ErrConfigKeyInvalid = fmt.Errorf("invalid config key")
ErrConfigKeyInvalid is invalid config key error
var ErrConfigParse = fmt.Errorf("config parse error")
ErrConfigParse is config parse error
var ErrConfigSchema = fmt.Errorf("config schema error")
ErrConfigSchema is config schema error
var ErrConfigTransformUnsupported = fmt.Errorf("unsupported config transform")
ErrConfigTransformUnsupported is unsupported config transform
var ErrConfigVersionInvalid = fmt.Errorf("invalid config version")
ErrConfigVersionInvalid is invalid config version
var ErrConfigVersionUnsupported = fmt.Errorf("unsupported config version")
ErrConfigVersionUnsupported is unsupported config version
var ReCurlyBraces = regexp.MustCompile(`^\{.*\}$`)
Functions ¶
func BaseVersion ¶
BaseVersion returns base-version for ver
func ContextKey ¶
func CreateSetConfigCmdList ¶
func CreateSetConfigCmdList(log logr.Logger, configMap DynamicConfigMap, conn deployment.ASConnInterface, aerospikePolicy *aero.ClientPolicy, ) ([]string, error)
CreateSetConfigCmdList creates set-config commands for given config.
func GetASConfig ¶
func GetASConfig(path *string, conn *deployment.ASConn, aerospikePolicy *aero.ClientPolicy) ( confToReturn interface{}, err error)
GetASConfig returns the value of the given path from the aerospike config from given host.
func GetDefault ¶
GetDefault return the map of default values.
func GetDynamic ¶
GetDynamic return the map of values which are dynamic values.
func GetFlatKey ¶
func Init ¶
Init initializes aerospike schemas. Init needs to be called before using this package.
schemaDir is the path to directory having the aerospike config schemas.
func InitFromMap ¶
InitFromMap init schema map from a map. Map key format -> 4.1.0 Map value format -> string of json schema
func IsAllDynamicConfig ¶
IsAllDynamicConfig returns true if all the fields in the given configMap are dynamically configured.
func IsDynamicConfig ¶
func IsDynamicConfig(log logr.Logger, dynamic sets.Set[string], conf string, valueMap map[Operation]interface{}) bool
IsDynamicConfig returns true if the given field is dynamically configured.
func IsSupportedVersion ¶
IsSupportedVersion returns true if version supported else false
func IsValidUpgrade ¶
IsValidUpgrade validates fromVersion and toVersion for all upgrade/downgrade restrictions
func SingularOf ¶
SingularOf returns the singular of the input noun.
Types ¶
type AsConfig ¶
type AsConfig struct {
// contains filtered or unexported fields
}
AsConfig is wrapper over Conf
func FromConfFile ¶
FromConfFile unmarshales the aerospike config text in "in" into a new *AsConfig
func NewMapAsConfig ¶
NewMapAsConfig creates AsConfig. Typically, an unmarshalled yaml file is passed in
func (*AsConfig) GetFlatMap ¶
GetFlatMap returns a pointer to the copy of the flattened config stored in cfg
type Conf ¶
Conf is format for configs It has list for named sections like namespace, set, dc, tls, logging file
type ConfGetter ¶
ConfGetter is an interface that defines methods for retrieving configurations.
type DynamicConfigMap ¶
DynamicConfigMap is a map of config flatten keys and their operations and values for eg: "xdr.dcs.{DC3}.node-address-ports": {Remove: []string{"1.1.2.1 3000"}}
func ConfDiff ¶
func ConfDiff( log logr.Logger, desiredConf, currentConf Conf, isFlat bool, ver string, ) (DynamicConfigMap, error)
ConfDiff find diff between two configs;
diff = desired - current if any config parameter is present in current but not in desired, result map will contain the corresponding default value for that config parameter.
It returns a map of flatten conf key and value(which is another map of added and removed fields, mostly helps in the case of list of string fields)
type GenConf ¶
func GenerateConf ¶
GenerateConf generates the config based on the provided log and ConfGetter. If removeDefaults is true, it will remove default values from the config. Without removeDefaults, the config that is generate will not be valid. Many default values are out of the acceptable range required by the server.
type GetConfigStep ¶
type GetConfigStep struct {
// contains filtered or unexported fields
}
GetConfigStep is a pipeline step that retrieves the configs and metadata.
type GetFlatSchemaStep ¶
type GetFlatSchemaStep struct {
// contains filtered or unexported fields
}
GetFlatSchema
type ServerVersionCheckStep ¶
type ServerVersionCheckStep struct {
// contains filtered or unexported fields
}
ServerVersionCheckStep is a pipeline step that checks if the server version is supported.
type ValidationErr ¶
type ValidationErr struct {
Value interface{}
ErrType string
Context string
Description string
Field string
}
ValidationErr represents version validation error
func ConfValuesValid ¶
func ConfValuesValid(flatConf *Conf) []*ValidationErr