provide timeout option and lower default

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-03-10 01:04:58 +03:00
parent 68696aebd5
commit 16cde1bfae
2 changed files with 14 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
package vault
import (
"time"
"github.com/hashicorp/vault/api"
"github.com/unistack-org/micro/v3/config"
)
@@ -40,3 +42,9 @@ type secretIDKey struct{}
func SecretID(secret string) config.Option {
return config.SetOption(secretIDKey{}, secret)
}
type timeoutKey struct{}
func Timeout(td time.Duration) config.Option {
return config.SetOption(timeoutKey{}, td)
}