/go-config-manager

Golang Config Manager

Primary LanguageGoMIT LicenseMIT

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