Skip to content

A simple library to read configuration from different sources

License

Notifications You must be signed in to change notification settings

Oleexo/config-go

Repository files navigation

Config go

Config go is a simple go package that allows you to read configuration from a file or environment variables.

Installation

go get github.com/Oleexo/config-go

Usage

package main

import (
	"fmt"
	"github.com/Oleexo/config-go"
	"github.com/Oleexo/config-go/dotenv"
	"github.com/Oleexo/config-go/envs"
	"github.com/Oleexo/config-go/mem"
)

func main() {
	config := config.NewConfiguration(
		mem.WithMemory(map[string]string{
			"key": "value",
		}),
		envs.WithEnvironmentVariables(),
		dotenv.WithDotenv(),
	)

	fmt.Println(config.Get("key"))
}

About

A simple library to read configuration from different sources

Topics

Resources

License

Stars

Watchers

Forks

Languages