appconfig

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README

appconfig

GoDoc Build Status

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")
Supported platforms

appconfig is built to work on any platform that supports Go.

Documentation

Overview

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")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(config interface{}, app string) error

Load will load an existing "config" for "app". It supports structs of `json`, `yaml` and `xml` format.

func Update

func Update(config interface{}, app string) error

Update encodes the provided "config" and saves it to the "app" config file. It supports structs of `json`, `yaml` and `xml` format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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