feat: working version
1. implemented filesystem storage, NATS object storage and saving to Vault. 2. Test coverage is fine for filesystem and Vault (and NATS object does not really require extensive tests)
This commit is contained in:
18
storageutil/vault.go
Normal file
18
storageutil/vault.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package storageutil
|
||||
|
||||
import "github.com/hashicorp/vault/api"
|
||||
|
||||
func NewVaultApiClient(token string, addr string) (*api.Client, error) {
|
||||
conf := &api.Config{
|
||||
Address: addr,
|
||||
}
|
||||
|
||||
c, err := api.NewClient(conf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.SetToken(token)
|
||||
|
||||
return c, nil
|
||||
}
|
Reference in New Issue
Block a user