Skip to content

Yprolic/TomlConfiguration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TomlConfiguration

A simple configuration with Toml File. supports default tag.

Install

go get github.com/Yprolic/TomlConfiguration

Usage and Examples

Lets define and struct that defines our configuration

type Server struct {
	Name    string 
	Port    int    `default:"6060"`
	Enabled bool
	Users   []string
}

Load the configuration into multiconfig:

m := TOMLLoader{Path: "conf/conf.toml"}
serverConf := &Server{}
err := m.Load(s)

serverConf.Port // by default 6060
serverConf.Name // "prolic"

License

The MIT License (MIT) - see LICENSE for more details

About

A simple configuration with Toml File.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages