config

package
v0.0.0-...-d3bb3ff Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedConfig

type AdvancedConfig struct {
	PingMessage string `yaml:"ping_message"`
}

AdvancedConfig holds advanced application's configuration

type Config

type Config struct {
	Advanced AdvancedConfig `yaml:"advanced"`
}

Config is the struct that holds our application's configuration

func UnmarshalConfig

func UnmarshalConfig(configData []byte) (*Config, error)

UnmarshalConfig unmarshalls file bytes to advanced config

type MutexConfigManager

type MutexConfigManager struct {
	// contains filtered or unexported fields
}

MutexConfigManager manages the configuration instance by preforming locking around access to the Config struct.

func InitAdvancedConfig

func InitAdvancedConfig() (*MutexConfigManager, *config.FileWatcher, error)

InitAdvancedConfig inits config

func NewMutexConfigManager

func NewMutexConfigManager(conf *AdvancedConfig) *MutexConfigManager

NewMutexConfigManager constructs new MutexConfigManager

func (*MutexConfigManager) Close

func (m *MutexConfigManager) Close()

Close shuts manager down

func (*MutexConfigManager) Get

Get returns current config

func (*MutexConfigManager) Set

func (m *MutexConfigManager) Set(confBytes []byte) error

Set sets new config

Jump to

Keyboard shortcuts

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