Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

๐Ÿ’• Minimal and safe way to load in configuration files without any extra boilerplate, made for my own personal usage!

License

Notifications You must be signed in to change notification settings

AugustArchive/config-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’• config-loader

Minimal and safe way to load in configuration files without any extra boilerplate, made for my own personal usage!

Why did you build this?

Because, I didn't want to repeat and copy/paste code into the Go projects I am creating, so I made it into a tiny package that everyone can use, but you don't have to!

Usage

$ go get go.floofy.dev/config
package main

import (
	"fmt"
	"go.floofy.dev/config"
)

func main() {
	fmt.Println("reading config from ./config.yml!")
	loader := config.NewLoader(config.WithTOML(), config.AutomaticEnv("PREFIX"))
	cfg, err := loader.Load()
	if err != nil {
		panic(err)
    }
	
	val := cfg.Get("owo.da.uwu") // => interface{} (can be `nil`)
	fmt.Println("got owo.da.uwu => %v", val)
}

License

config-loader is released under the Apache 2.0 License.

About

๐Ÿ’• Minimal and safe way to load in configuration files without any extra boilerplate, made for my own personal usage!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages