go-config-manager

module
v0.0.0-...-510732f Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2016 License: MIT

README

Golang Config Manager

Go Report Card

Installation:

go get github.com/gkiryaziev/go-config-manager

Usage:

import (
	"fmt"
	yamlCfg "github.com/gkiryaziev/go-config-manager/yaml"
)

// Config struct
type Config struct {
	Name string `yaml:"name"`
	Age  int    `yaml:"age"`
}

	// config object
	var config Config

	// config manager
	err := yamlCfg.NewConfig("config.yaml").Load(&config)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(config.Name, config.Age)
#config.yaml

name: "John"
age:  30

Directories

Path Synopsis
Package yaml provides configuration loading from yaml file.
Package yaml provides configuration loading from yaml file.

Jump to

Keyboard shortcuts

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