config

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config contains utilities for reading and parsing service configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(path string, replaceEnvs bool, config interface{}) error

Read will attempt to read a configuration file path into a structure.

func ReplaceEnvVariables

func ReplaceEnvVariables(configBytes []byte) []byte

ReplaceEnvVariables will search a blob of data (assumed to be a config) for the pattern `${FOO:bar}`, where `FOO` is an environment variable name and `bar` is a default value. The `bar` section (including the colon) can be left out if there is no appropriate default value for the field.

For each aforementioned pattern found in the blob the contents of the respective environment variable will be read and will replace the pattern in the config. If the environment variable is empty or does not exist then either the default value is used or the field will be empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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