Discover Packages
github.com/qeubar/appconfig
package
module
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Aug 9, 2020
License: GPL-3.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
appconfig
appconfig is a very simple platform independent config file management.
Usage
import "github.com/quebar/appconfig"
type MyConfig struct {
Name string `yaml:"user_name"`
Email string `yaml:"user_email"`
}
conf := MyConfig{
Name: "QeuBar",
Email: "que@bar.com",
}
appconfig.Update(conf, "my-app")
appconfig is built to work on any platform that supports Go.
Expand ▾
Collapse ▴
Documentation
¶
Package appconfig provides a minimal interface to store and update user specific
application config on the supported platform. It takes away guess work and indecisiveness by
using the default application config directory based on the running platform.
It's as simple as:
type MyConfig struct {
Name string `yaml:"user_name"`
Email string `yaml:"user_email"`
}
var conf MyConfig
appconfig.Load(&conf, "my-app")
Load will load an existing "config" for "app".
It supports structs of `json`, `yaml` and `xml` format.
Update encodes the provided "config" and saves it to the "app" config file.
It supports structs of `json`, `yaml` and `xml` format.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.