config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoResults = errors.Errorf("has no results")
)

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 (e *ConfigManager) GetNamespace(ctx context.Context, ns string) (*config.Namespace, error)

func (*ConfigManager) Init

func (e *ConfigManager) Init(ctx context.Context, logger *zap.Logger, configFile string, overlay *config.Config) error

func (*ConfigManager) ListAllNamespace

func (e *ConfigManager) ListAllNamespace(ctx context.Context) ([]*config.Namespace, error)

func (*ConfigManager) SetNamespace

func (e *ConfigManager) SetNamespace(ctx context.Context, ns string, nsc *config.Namespace) error

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

type KVValue

type KVValue struct {
	Key   string
	Value []byte
}

Jump to

Keyboard shortcuts

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