asconfig

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 7

Documentation

Index

Constants

View Source
const (
	FSPATH  sysproptype = "FSPATH"
	NETADDR sysproptype = "NETADDR"
	DEVICE  sysproptype = "DEVICE"
	NONE    sysproptype = "NONE"
)

types of system properties

Variables

View Source
var ErrConfigKeyInvalid = fmt.Errorf("invalid config key")

ErrConfigKeyInvalid is invalid config key error

View Source
var ErrConfigParse = fmt.Errorf("config parse error")

ErrConfigParse is config parse error

View Source
var ErrConfigSchema = fmt.Errorf("config schema error")

ErrConfigSchema is config schema error

View Source
var ErrConfigTransformUnsupported = fmt.Errorf("unsupported config transform")

ErrConfigTransformUnsupported is unsupported config transform

View Source
var ErrConfigVersionInvalid = fmt.Errorf("invalid config version")

ErrConfigVersionInvalid is invalid config version

View Source
var ErrConfigVersionUnsupported = fmt.Errorf("unsupported config version")

ErrConfigVersionUnsupported is unsupported config version

Functions

func BaseVersion

func BaseVersion(ver string) (string, error)

BaseVersion returns base-version for ver

func Init

func Init(log logr.Logger, schemaDir string) error

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

func InitFromMap(log logr.Logger, schemaMap map[string]string)

InitFromMap init schema map from a map. Map key format -> 4.1.0 Map value format -> string of json schema

func IsSupportedVersion

func IsSupportedVersion(ver string) (bool, error)

IsSupportedVersion returns true if version supported else false

func PluralOf

func PluralOf(noun string) string

PluralOf returns the plural of the input noun.

func SingularOf

func SingularOf(noun string) string

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

func FromConfFile(log logr.Logger, _ string, in io.Reader) (*AsConfig, error)

FromConfFile unmarshales the aerospike config text in "in" into a new *AsConfig

func New

func New(log logr.Logger, bconf *Conf) *AsConfig

func NewMapAsConfig

func NewMapAsConfig(
	log logr.Logger, configMap map[string]interface{},
) (*AsConfig, error)

NewMapAsConfig creates AsConfig. Typically an unmarshalled yaml file is passed in

func (*AsConfig) GetFlatMap

func (cfg *AsConfig) GetFlatMap() *Conf

GetFlatMap returns a pointer to the copy of the flattened config stored in cfg

func (*AsConfig) IsValid

func (cfg *AsConfig) IsValid(log logr.Logger, version string) (
	bool, []*ValidationErr, error,
)

IsValid checks validity of config

func (*AsConfig) ToConfFile

func (cfg *AsConfig) ToConfFile() DotConf

ToConfFile returns DotConf

func (*AsConfig) ToMap

func (cfg *AsConfig) ToMap() *Conf

ToMap returns a pointer to the expanded map form of AsConfig

type CfgValue

type CfgValue struct {
	Value   interface{}
	Context string
	Name    string
}

CfgValue is config details

type Conf

type Conf = lib.Stats

Conf is format for configs It has list for named sections like namespace, set, dc, tls, logging file

type ConfGetter added in v1.1.0

type ConfGetter interface {
	AllConfigs() (Conf, error)
	GetAsInfo(cmdList ...string) (Conf, error)
}

ConfGetter is an interface that defines methods for retrieving configurations.

type DotConf

type DotConf = string

DotConf is string of aerospike.conf content

type GenConf added in v1.1.0

type GenConf struct {
	Conf    Conf
	Version string
}

func GenerateConf added in v1.1.0

func GenerateConf(log logr.Logger, confGetter ConfGetter, removeDefaults bool) (*GenConf, error)

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 added in v1.1.0

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

GetConfigStep is a pipeline step that retrieves the configs and metadata.

type GetFlatSchemaStep added in v1.1.0

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

GetFlatSchema

type ServerVersionCheckStep added in v1.1.0

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

Jump to

Keyboard shortcuts

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