22 lines
369 B
Go
22 lines
369 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"time"
|
||
|
|
||
|
"github.com/hashicorp/vault-client-go"
|
||
|
)
|
||
|
|
||
|
var Client *vault.Client
|
||
|
|
||
|
func Init(token string) {
|
||
|
var err error
|
||
|
Client, err = vault.New(vault.WithAddress("https://vault.ctdo.de"), vault.WithRequestTimeout(30*time.Second))
|
||
|
if err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
if err := Client.SetToken(token); err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
}
|