config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package config provides configuration loader based on env vars.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(prefix string, spec interface{}, sources ...func() error) error

Load loads config from ENV vars, sources are called to populate ENV vars in advance.

In no sources are provided then vars from .env.template, .env, .env.<ENVIRONMENT> files are loaded if available. Use nil or any other source to avoid that.

func WithEnvFiles

func WithEnvFiles(files ...string) func() error

WithEnvFiles populates env vars from provided files.

It returns an error if file does not exist.

func WithOptionalEnvFiles

func WithOptionalEnvFiles(files ...string) func() error

WithOptionalEnvFiles populates env vars from provided files that exist.

Non-existent files are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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