Documentation ¶
Index ¶
- type CfgManager
- func (c *CfgManager) Get(_ context.Context, key string) *metadata.ConfigureValue
- func (c *CfgManager) GetAll(ctx context.Context) map[string]interface{}
- func (c *CfgManager) GetDatabaseCfg() *models.Database
- func (c *CfgManager) GetUserCfgs(ctx context.Context) map[string]interface{}
- func (c *CfgManager) Load(ctx context.Context) error
- func (c *CfgManager) LoadDefault()
- func (c *CfgManager) LoadSystemConfigFromEnv()
- func (c *CfgManager) Save(ctx context.Context) error
- func (c *CfgManager) Set(_ context.Context, key string, value interface{})
- func (c *CfgManager) UpdateConfig(ctx context.Context, cfgs map[string]interface{}) error
- func (c *CfgManager) ValidateCfg(ctx context.Context, cfgs map[string]interface{}) error
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 ¶
func (c *CfgManager) Get(_ context.Context, key string) *metadata.ConfigureValue
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) 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.
Click to show internal directories.
Click to hide internal directories.