Skip to content

Commit 701c829

Browse files
committed
Update README
1 parent 97ca592 commit 701c829

File tree

3 files changed

+20
-136
lines changed

3 files changed

+20
-136
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# Output of the go coverage tool, specifically when used with LiteIDE
1515
*.out
16+
*.html
1617

1718
# Dependency directories (remove the comment below to include it)
1819
# vendor/

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
# secretenv
2-
Golang package for reading secrets from file and ENV variables.
2+
This is a Golang package for reading secrets from files and environment variables.
3+
4+
# Usage
5+
6+
Inject secrets into your container.
7+
8+
You can optionally specify an environment variable suffixed with `_FILE` to indicate the location of the secret. For example, `DB_PASSWORD_FILE=/run/secrets/db_password`.
9+
10+
To read its content:
11+
12+
```go
13+
import "github.com/ndthuan/secretenv"
14+
15+
func main() {
16+
dbPassword := secretenv.Get("DB_PASSWORD")
17+
}
18+
```
19+
20+
If `DB_PASSWORD_FILE` does not exist or there is an error reading it, the value of the environment variable `DB_PASSWORD` will be returned.

cover.html

-135
This file was deleted.

0 commit comments

Comments
 (0)