config

package module
v0.0.0-...-ef85f60 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-env-config

Provides simple access to .env configuraitions

Documentation

Overview

Provides logic to read and parse env files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetVariables(variables map[string]*string) error
	GetVariable(s string) (string, error)
}

type EnvConfig

type EnvConfig struct {
	Environment     *string // the environment that relates to the file to be parsed
	EnvironmentPath *string // the location where the environment file is located
}

EnvConfig handles configuration from env files. It implements the config.Config interface.

func (EnvConfig) GetVariable

func (c EnvConfig) GetVariable(s string) (string, error)

func (EnvConfig) GetVariables

func (c EnvConfig) GetVariables(variables map[string]*string) error

GetVariables reads each key of the given map, searches the env file for this key and assign the value to the maps variable.

Jump to

Keyboard shortcuts

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