configfilemanager

package
v0.1.13-beta3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigfile

func LoadConfigfile(configfilename string) ([]byte, bool, error)

LoadConfigfile loads data from the named file in the kutti config directory. If the named file does not exist, the second returned value is true

func SaveConfigfile

func SaveConfigfile(configfilename string, data []byte) error

SaveConfigfile saves the specified data into the named file in the kutti config directory.

Types

type ConfigManager

type ConfigManager interface {
	Load() error
	Save() error
}

ConfigManager saves and loads configuration data from a file in the kutti config directory

func New

func New(filename string, s Configdata) ConfigManager

New returns a new Configmanager

type Configdata

type Configdata interface {
	Serialize() ([]byte, error)
	Deserialize([]byte) error
	Setdefaults()
}

Configdata provides methods for serializing and deserializing config data, and setting default values. These methods will be called by a ConfigManager as appropriate.

Jump to

Keyboard shortcuts

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