Skip to content
Manage and load configuration files easily in GoLang
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
config.go

README.md

Go Configuration Manager

Installation

go get https://gitlab.com/rosenpin/config-manager

Usage

  1. Create a configuration struct for your project. IE: models.Config
    type Config struct {
        Path
        Port
        Username
        ...
    }
  1. Create the configuration file. IE: config.yaml
Path: /home/user/projectpath
Port: 8080
Username: rosenpin
  1. Load the configuration
configLoader := config.NewLoader("config.yaml")

config := &models.Config{}

err := configLoader.Load(yaml.Unmarshal, config) 
if err != nil {
    panic(err)
}
You can’t perform that action at this time.