conf

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfFileName  = "kuiper.yaml"
	DebugLogLevel = "debug"
	InfoLogLevel  = "info"
	WarnLogLevel  = "warn"
	ErrorLogLevel = "error"
	FatalLogLevel = "fatal"
	PanicLogLevel = "panic"
)
View Source
const (
	KuiperBaseKey = "KuiperBaseKey"
)
View Source
const Separator = "__"

Variables

View Source
var (
	Config    *model.KuiperConf
	IsTesting bool
	TestId    string
)
View Source
var CloseLogger = logger.CloseLogger
View Source
var LoadConfigCache map[string]map[string]interface{}
View Source
var (
	Log = logger.Log
)

Functions

func ClearKVStorage

func ClearKVStorage() error

ClearKVStorage only used in unit test

func CorrectsConfigKeysByJson

func CorrectsConfigKeysByJson(configs map[string]interface{}, jsonFilePath string) error

func DropCfgKeyFromStorage

func DropCfgKeyFromStorage(typ string, plugin string, confKey string) error

DropCfgKeyFromStorage ...

func GetAllConnConfigs

func GetAllConnConfigs() (map[string]map[string]map[string]any, error)

GetAllConnConfigs return connections' plugin -> confKey -> props

func GetCfgFromKVStorage

func GetCfgFromKVStorage(typ string, plugin string, confKey string) (map[string]map[string]interface{}, error)

GetCfgFromKVStorage ...

func GetConfLoc

func GetConfLoc() (s string, err error)

func GetDataLoc

func GetDataLoc() (s string, err error)

func GetEnv

func GetEnv() map[string]string

func GetLoc

func GetLoc(subdir string) (string, error)

GetLoc subdir must be a relative path

func GetLogLoc

func GetLogLoc() (string, error)

func GetMetricsLoc added in v2.1.0

func GetMetricsLoc() (string, error)

func GetPluginsLoc

func GetPluginsLoc() (s string, err error)

func GetYamlConfigAllKeys

func GetYamlConfigAllKeys(typ string) (map[string]struct{}, error)

GetYamlConfigAllKeys get all plugin keys about sources/sinks/connections

func InitConf

func InitConf()

func InitMetricsFolder added in v2.1.0

func InitMetricsFolder() error

func LoadCfgKeyKV

func LoadCfgKeyKV(key string) (map[string]interface{}, error)

func LoadConfig

func LoadConfig(c interface{}) error

func LoadConfigByName

func LoadConfigByName(name string, c interface{}) error

func LoadConfigFromPath

func LoadConfigFromPath(p string, c interface{}) error

func NewSqliteKVStore

func NewSqliteKVStore(table string) (*sqlKVStore, error)

func Printable

func Printable(m map[string]interface{}) map[string]interface{}

func SaveCfgKeyToKV

func SaveCfgKeyToKV(key string, cfg map[string]interface{}) error

SaveCfgKeyToKV ...

func SetConsoleAndFileLog

func SetConsoleAndFileLog(consoleLog, fileLog bool) error

func SetLogFormat

func SetLogFormat(disableTimestamp bool)

func SetLogLevel

func SetLogLevel(level string, debug bool)

func SetupEnv

func SetupEnv()

func ValidateRuleOption

func ValidateRuleOption(option *def.RuleOption) error

func WriteCfgIntoKVStorage

func WriteCfgIntoKVStorage(typ string, plugin string, confKey string, confData map[string]interface{}) error

WriteCfgIntoKVStorage ...

Types

type ConfKeysOperator

type ConfKeysOperator interface {
	GetPluginName() string
	GetConfContentByte() ([]byte, error)
	// CopyConfContent get the configurations in etc and data folder
	CopyConfContent() map[string]map[string]interface{}
	// CopyReadOnlyConfContent get the configurations in etc folder
	CopyReadOnlyConfContent() map[string]map[string]interface{}
	// CopyUpdatableConfContent get the configurations in data folder
	CopyUpdatableConfContent() map[string]map[string]interface{}
	// CopyUpdatableConfContentFor get the configuration for the specific configKeys
	CopyUpdatableConfContentFor(configKeys []string) map[string]map[string]interface{}
	// LoadConfContent load the configurations into data configuration part
	LoadConfContent(cf map[string]map[string]interface{})
	GetConfKeys() (keys []string)
	GetReadOnlyConfKeys() (keys []string)
	GetUpdatableConfKeys() (keys []string)
	DeleteConfKey(confKey string)
	DeleteConfKeyField(confKey string, reqField map[string]interface{}) error
	AddConfKey(confKey string, reqField map[string]interface{}) error
	AddConfKeyField(confKey string, reqField map[string]interface{}) error
	ClearConfKeys()
}

ConfKeysOperator define interface to query/add/update/delete the configs in memory

type ConfigKeys

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

ConfigKeys implement ConfKeysOperator interface, load the configs from etc/sources/xx.yaml and et/connections/connection.yaml Hold the connection configs for each connection type in etcCfg field Provide method to query/add/update/delete the configs

func (*ConfigKeys) AddConfKey

func (c *ConfigKeys) AddConfKey(confKey string, reqField map[string]interface{}) error

func (*ConfigKeys) AddConfKeyField

func (c *ConfigKeys) AddConfKeyField(confKey string, reqField map[string]interface{}) error

func (*ConfigKeys) ClearConfKeys

func (c *ConfigKeys) ClearConfKeys()

func (*ConfigKeys) CopyConfContent

func (c *ConfigKeys) CopyConfContent() map[string]map[string]interface{}

func (*ConfigKeys) CopyReadOnlyConfContent

func (c *ConfigKeys) CopyReadOnlyConfContent() map[string]map[string]interface{}

func (*ConfigKeys) CopyUpdatableConfContent

func (c *ConfigKeys) CopyUpdatableConfContent() map[string]map[string]interface{}

func (*ConfigKeys) CopyUpdatableConfContentFor

func (c *ConfigKeys) CopyUpdatableConfContentFor(configKeys []string) map[string]map[string]interface{}

func (*ConfigKeys) DeleteConfKey

func (c *ConfigKeys) DeleteConfKey(confKey string)

func (*ConfigKeys) DeleteConfKeyField

func (c *ConfigKeys) DeleteConfKeyField(confKey string, reqField map[string]interface{}) error

func (*ConfigKeys) GetConfContentByte

func (c *ConfigKeys) GetConfContentByte() ([]byte, error)

func (*ConfigKeys) GetConfKeys

func (c *ConfigKeys) GetConfKeys() (keys []string)

func (*ConfigKeys) GetPluginName

func (c *ConfigKeys) GetPluginName() string

func (*ConfigKeys) GetReadOnlyConfKeys

func (c *ConfigKeys) GetReadOnlyConfKeys() (keys []string)

func (*ConfigKeys) GetUpdatableConfKeys

func (c *ConfigKeys) GetUpdatableConfKeys() (keys []string)

func (*ConfigKeys) LoadConfContent

func (c *ConfigKeys) LoadConfContent(cf map[string]map[string]interface{})

type ConfigOperator

type ConfigOperator interface {
	ConfKeysOperator
	SaveCfgToStorage() error
}

ConfigOperator define interface to query/add/update/delete the configs in disk

func NewConfigOperatorForConnection

func NewConfigOperatorForConnection(pluginName string) ConfigOperator

NewConfigOperatorForConnection construct function

func NewConfigOperatorForSink

func NewConfigOperatorForSink(pluginName string) ConfigOperator

NewConfigOperatorForSink construct function

func NewConfigOperatorForSource

func NewConfigOperatorForSource(pluginName string) ConfigOperator

NewConfigOperatorForSource construct function

func NewConfigOperatorFromConnectionStorage

func NewConfigOperatorFromConnectionStorage(pluginName string) (ConfigOperator, error)

NewConfigOperatorFromConnectionStorage construct function, Load the configs from et/connections/connection.yaml

func NewConfigOperatorFromSinkStorage

func NewConfigOperatorFromSinkStorage(pluginName string) (ConfigOperator, error)

NewConfigOperatorFromSinkStorage construct function, Load the configs from etc/sources/xx.yaml

func NewConfigOperatorFromSourceStorage

func NewConfigOperatorFromSourceStorage(pluginName string) (ConfigOperator, error)

NewConfigOperatorFromSourceStorage construct function, Load the configs from etc/sources/xx.yaml

type ConnectionConfigKeysOps

type ConnectionConfigKeysOps struct {
	*ConfigKeys
}

ConnectionConfigKeysOps implement ConfOperator interface, load the configs from et/connections/connection.yaml

func (*ConnectionConfigKeysOps) SaveCfgToStorage

func (p *ConnectionConfigKeysOps) SaveCfgToStorage() error

type EnvManager

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

func (*EnvManager) GetEnv

func (e *EnvManager) GetEnv() map[string]string

func (*EnvManager) Setup

func (e *EnvManager) Setup()

type JsonPathEval

type JsonPathEval interface {
	Eval(data interface{}) (interface{}, error)
}

func GetJsonPathEval

func GetJsonPathEval(jsonpath string) (JsonPathEval, error)

type PathConfigure

type PathConfigure struct {
	LoadFileType string
	Dirs         map[string]string
}
var (
	PathConfig      PathConfigure
	AbsoluteMapping = map[string]string{
					// contains filtered or unexported fields
	}
)

type SinkConfigKeysOps

type SinkConfigKeysOps struct {
	*ConfigKeys
}

SinkConfigKeysOps implement ConfOperator interface, load the configs from data/sinks/xx.yaml

func (*SinkConfigKeysOps) SaveCfgToStorage

func (c *SinkConfigKeysOps) SaveCfgToStorage() error

type SourceConfigKeysOps

type SourceConfigKeysOps struct {
	*ConfigKeys
}

SourceConfigKeysOps implement ConfOperator interface, load the configs from etc/sources/xx.yaml

func (*SourceConfigKeysOps) SaveCfgToStorage

func (c *SourceConfigKeysOps) SaveCfgToStorage() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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