config

package
v0.0.0-...-e749f68 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

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

func CreateConfigManager

func CreateConfigManager() *ConfigManager

func (*ConfigManager) ApplyPendingChanges

func (m *ConfigManager) ApplyPendingChanges() error

ApplyPendingChanges Takes all pending Changes and Tries to Apply them using the Registered Apply Functions. In Case of error it Attempts to Revert to the Current Config

func (*ConfigManager) AreChangesPending

func (m *ConfigManager) AreChangesPending() bool

func (*ConfigManager) DiscardPendingConfig

func (m *ConfigManager) DiscardPendingConfig() error

func (*ConfigManager) GetCurrentConfig

func (m *ConfigManager) GetCurrentConfig() config.Config

func (*ConfigManager) GetPendingChangelog

func (m *ConfigManager) GetPendingChangelog() (diff.Changelog, error)

func (*ConfigManager) GetPendingConfig

func (m *ConfigManager) GetPendingConfig() config.Config

func (*ConfigManager) LoadCurrentConfigFromDisk

func (m *ConfigManager) LoadCurrentConfigFromDisk() error

func (*ConfigManager) LoadDefaultConfig

func (m *ConfigManager) LoadDefaultConfig() error

func (*ConfigManager) LoadPendingConfigFromDisk

func (m *ConfigManager) LoadPendingConfigFromDisk() error

func (*ConfigManager) RegisterApplyFunction

func (m *ConfigManager) RegisterApplyFunction(fn func(currentConfig config.Config, pendingConfig config.Config) error)

func (*ConfigManager) SaveWithoutApplying

func (m *ConfigManager) SaveWithoutApplying() error

func (*ConfigManager) StartTransaction

func (m *ConfigManager) StartTransaction() (*ConfigTransaction, *config.Config)

type ConfigTransaction

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

func (*ConfigTransaction) Commit

func (t *ConfigTransaction) Commit() error

func (*ConfigTransaction) Discard

func (t *ConfigTransaction) Discard()

Discard Discards the Transaction. Is a noop if The Transaction Already Finished due to a Commit() or another Discard()

Jump to

Keyboard shortcuts

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