config

package
v0.12.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyConfigItem           = errors.New("empty config item")
	ErrConflictConfigItemType    = errors.New("type of the config item conflicts between saved and registered")
	ErrEmptyConfigItemKey        = errors.New("empty config item key")
	ErrEmptyConfigItemValue      = errors.New("empty config item value")
	ErrUnsupportedConfigItem     = errors.New("unsupported config item")
	ErrEmptyBackendName          = errors.New("backend name should not be empty")
	ErrInvalidBackendNameCurrent = errors.New("backend name should not be current")
)
View Source
var (
	ErrNotExistCurrentBackend     = errors.New("cannot assign current to not exist backend")
	ErrUnsetDefaultCurrentBackend = errors.New("cannot unset default current backend")
	ErrInUseCurrentBackend        = errors.New("unset in-use current backend")
	ErrUnsupportedBackendType     = errors.New("unsupported backend type")
	ErrNonEmptyBackendConfigItems = errors.New("non-empty backend config items")
	ErrEmptyBackendType           = errors.New("empty backend type")
	ErrConflictBackendType        = errors.New("conflict backend type")
	ErrInvalidBackNameDefault     = errors.New("backend name should not be default")
)
View Source
var (
	ErrNotBool   = errors.New("not bool type")
	ErrNotInt    = errors.New("not int type")
	ErrNotString = errors.New("not string type")
)

Functions

func DeleteConfigItem

func DeleteConfigItem(key string) error

DeleteConfigItem deletes the config item in the config file, where the key is the corresponding config YAML keys connected by dot. The validation of the config is not checked.

func GetConfig

func GetConfig() (*v1.Config, error)

GetConfig returns the structured config stored in the config file. The validation of the config is not checked.

func GetEncodedConfigItem

func GetEncodedConfigItem(key string) (string, error)

GetEncodedConfigItem gets the value of config item after encoding from the config file, where the key is the corresponding config YAML keys connected by dot. The validation of the config is not checked.

func SetEncodedConfigItem

func SetEncodedConfigItem(key, strValue string) error

SetEncodedConfigItem sets the config item with the encoded value in the config file, where the key is the corresponding config YAML keys connected by dot. The validation of the config is checked.

Types

This section is empty.

Jump to

Keyboard shortcuts

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