config

package
v0.0.0-...-969384c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CfgManager

type CfgManager struct {
	Store *store.ConfigStore
}

CfgManager ... Configure Manager

func (*CfgManager) Get

Get ...

func (*CfgManager) GetAll

func (c *CfgManager) GetAll(ctx context.Context) map[string]interface{}

GetAll get all settings.

func (*CfgManager) GetDatabaseCfg

func (c *CfgManager) GetDatabaseCfg() *models.Database

GetDatabaseCfg - Get database configurations

func (*CfgManager) GetUserCfgs

func (c *CfgManager) GetUserCfgs(ctx context.Context) map[string]interface{}

GetUserCfgs retrieve all user configs

func (*CfgManager) Load

func (c *CfgManager) Load(ctx context.Context) error

Load load configuration from storage, like database or redis

func (*CfgManager) LoadDefault

func (c *CfgManager) LoadDefault()

LoadDefault ...

func (*CfgManager) LoadSystemConfigFromEnv

func (c *CfgManager) LoadSystemConfigFromEnv()

LoadSystemConfigFromEnv ...

func (*CfgManager) Save

func (c *CfgManager) Save(ctx context.Context) error

Save - Save all current configuration to storage

func (*CfgManager) Set

func (c *CfgManager) Set(_ context.Context, key string, value interface{})

Set ...

func (*CfgManager) UpdateConfig

func (c *CfgManager) UpdateConfig(ctx context.Context, cfgs map[string]interface{}) error

UpdateConfig - Update config Store with a specified configuration and also save updated configure.

func (*CfgManager) ValidateCfg

func (c *CfgManager) ValidateCfg(ctx context.Context, cfgs map[string]interface{}) error

ValidateCfg validate config by metadata. return the first error if exist.

Directories

Path Synopsis
db
dao
Package store is only used in the internal implement of manager, not a public api.
Package store is only used in the internal implement of manager, not a public api.

Jump to

Keyboard shortcuts

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