Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Schou-Andreasen committed Sep 9, 2021
1 parent 446c59f commit 290de99
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# gcp-secret-fetch
# gcpsecretfetch

Utility library for getting secrets from GCP Secret Manager.
The library works by accepting a pointer to a cfg struct that contains only string values, and then it populates the struct values with values from GCP for the corresponding secrets.

## Example

```go
type config struct {
MY_SECRET_NAME string
}

var cfg config

err := InitializeConfig(&cfg, "my-gcp-project")
```

## Viper support
The library also supports setting the values of the config struct directly in a `viper.Viper` instance.
```go
v := viper.New()

type config struct {
MY_SECRET_NAME string
}

var cfg config

err := InitializeConfig(&cfg, "my-gcp-project", WithViper(v))
```

0 comments on commit 290de99

Please sign in to comment.