Documentation ¶
Index ¶
- Variables
- type ConfigManager
- func (e *ConfigManager) Close() error
- func (e *ConfigManager) DelNamespace(ctx context.Context, ns string) error
- func (e *ConfigManager) GetConfig() *config.Config
- func (e *ConfigManager) GetConfigChecksum() uint32
- func (e *ConfigManager) GetNamespace(ctx context.Context, ns string) (*config.Namespace, error)
- func (e *ConfigManager) Init(ctx context.Context, logger *zap.Logger, configFile string, ...) error
- func (e *ConfigManager) ListAllNamespace(ctx context.Context) ([]*config.Namespace, error)
- func (e *ConfigManager) SetNamespace(ctx context.Context, ns string, nsc *config.Namespace) error
- func (e *ConfigManager) SetTOMLConfig(data []byte) (err error)
- func (e *ConfigManager) WatchConfig() <-chan *config.Config
- type KVValue
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoResults = errors.Errorf("has no results") ErrFail2Update = errors.Errorf("failed to update") )
Functions ¶
This section is empty.
Types ¶
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
func NewConfigManager ¶
func NewConfigManager() *ConfigManager
func (*ConfigManager) Close ¶
func (e *ConfigManager) Close() error
func (*ConfigManager) DelNamespace ¶
func (e *ConfigManager) DelNamespace(ctx context.Context, ns string) error
func (*ConfigManager) GetConfig ¶
func (e *ConfigManager) GetConfig() *config.Config
func (*ConfigManager) GetConfigChecksum ¶
func (e *ConfigManager) GetConfigChecksum() uint32
func (*ConfigManager) GetNamespace ¶
func (*ConfigManager) ListAllNamespace ¶
func (*ConfigManager) SetNamespace ¶
func (*ConfigManager) SetTOMLConfig ¶
func (e *ConfigManager) SetTOMLConfig(data []byte) (err error)
SetTOMLConfig will do partial config update. Usually, user will expect config changes only when they specified a config item. It is, however, impossible to tell a struct `c.max-conns == 0` means no user-input, or it specified `0`. So we always update the current config with a TOML string, which only overwrite fields that are specified by users.
func (*ConfigManager) WatchConfig ¶
func (e *ConfigManager) WatchConfig() <-chan *config.Config
Click to show internal directories.
Click to hide internal directories.