summaryrefslogtreecommitdiff
path: root/README.md
blob: 5a5a8a5994dad21fa9ad37e24f8c2ba54cb80e8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# ENV Library

Works like sh ENV, but is file based.

## Design goals

* backwards compatible: saved files are compatible with bash ENV syntax
* simple:               only string key=value pairs
* concurrent:           use file locks
* global:               ENV functions can be called from anywhere
* dynamic:              automaticly detect ENV changes by the file mtime

## Theory of Operation

The core philosophy of this library is to standardize ENV in a new way

ENV configuration files are loaded in this defined order:

1.  /usr/share/doc/foo/foo.env  # upstream application defaults
2.  /etc/foo/foo.env            # OS distribution defaults
3.  /etc/default/foo            # system admin overrides
4.  ~/.config/foo/foo.env       # your user settings

## function examples

```
key := ENV.Get("APIKEY")

if ENV.True("verbose") {
    fmt.Println("worked")
}

ENV.Set("LocalPort", "8080")
```