Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liammartens/konf-vlt
https://github.com/liammartens/konf-vlt
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/liammartens/konf-vlt
- Owner: LiamMartens
- License: mit
- Created: 2024-05-27T15:23:46.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-27T15:34:04.000Z (7 months ago)
- Last Synced: 2024-12-15T00:25:32.792Z (14 days ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# konfvlt
Can be used as a provider for [konf](https://github.com/nil-go/konf)
*Does not support watching at this time*## Usage
```go
package mainimport (
"os"konfvlt "github.com/LiamMartens/konf-vlt"
"github.com/nil-go/konf"
)func main() {
var config konf.Config
vault_config := konfvlt.VaultConfig{
OrganizationId: os.Getenv("ORGANIZATION_ID"),
ProjectId: os.Getenv("PROJECT_ID"),
ApplicationName: os.Getenv("APPLICATION_NAME"),
ClientId: os.Getenv("CLIENT_ID"),
ClientSecret: os.Getenv("CLIENT_SECRET"),
}
vlt_provider, err := konfvlt.New(vault_config, konfvlt.ProviderConfig{
SplitUnderscore: true,
})
if err != nil {
t.Fatalf("failed to authenticate with VLT (%s)", err.Error())
}
config.Load(vlt_provider)
konf.SetDefault(&config)
}
```