file

package
v2.2.16 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWatcher

func NewWatcher(file string) model.ConfigurationWatcher

Types

type ConfigurationStorage

type ConfigurationStorage struct {
	ServerConfigPath string
	UpdateChan       chan interface{}
	// contains filtered or unexported fields
}

ConfigurationStorage is a wrapper over server configuration file.

func NewConfigurationStorage

func NewConfigurationStorage(config model.ConfigStorageSettings) (*ConfigurationStorage, error)

NewConfigurationStorage creates and returns new file configuration storage.

func NewDefaultConfigurationStorage

func NewDefaultConfigurationStorage() (*ConfigurationStorage, error)

func (*ConfigurationStorage) CloseUpdateChan

func (cs *ConfigurationStorage) CloseUpdateChan()

CloseUpdateChan closes update channel.

func (*ConfigurationStorage) ForceReloadOnWriteConfig

func (cs *ConfigurationStorage) ForceReloadOnWriteConfig() bool

func (*ConfigurationStorage) GetUpdateChan

func (cs *ConfigurationStorage) GetUpdateChan() chan interface{}

GetUpdateChan returns update channel.

func (*ConfigurationStorage) LoadServerSettings

func (cs *ConfigurationStorage) LoadServerSettings(forceReload bool) (model.ServerSettings, error)

LoadServerSettings loads server settings from the file.

func (*ConfigurationStorage) WriteConfig

func (cs *ConfigurationStorage) WriteConfig(settings model.ServerSettings) error

WriteConfig writes new config to server configuration file.

type Watcher

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

func (*Watcher) ErrorChan

func (w *Watcher) ErrorChan() <-chan error

func (*Watcher) IsWatching

func (w *Watcher) IsWatching() bool

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) Watch

func (w *Watcher) Watch()

func (*Watcher) WatchChan

func (w *Watcher) WatchChan() <-chan bool

Jump to

Keyboard shortcuts

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