fconfig

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fconfig provides support to load config files and expand secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(file string, config interface{}) error

LoadConfig loads the configuration from a given file and unmarshal it into the provided config. It maps the fields using `mapstructure` tag.

Example:

type Config struct {
	 Env   string `mapstructure:env`
	 DBUri string `mapstructure:db_uri`
}

It expands the environment variables if the value matches `${ENV_NAME}`. It fetches the secret if the value matches gSecret://uri.

func LoadEnv

func LoadEnv(filename string) error

LoadEnv load environments variables from a file. If no file name is given it will try to load .env file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL