mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-18 08:26:45 +02:00
27 lines
592 B
Go
27 lines
592 B
Go
// Copyright 2018 Drone.IO Inc
|
|
// Use of this software is governed by the Drone Enterpise License
|
|
// that can be found in the LICENSE file.
|
|
|
|
package vault
|
|
|
|
import "time"
|
|
|
|
// Opts sets custom options for the vault client.
|
|
type Opts func(v *vault)
|
|
|
|
// WithTTL returns an options that sets a TTL used to
|
|
// refresh periodic tokens.
|
|
func WithTTL(d time.Duration) Opts {
|
|
return func(v *vault) {
|
|
v.ttl = d
|
|
}
|
|
}
|
|
|
|
// WithRenewal returns an options that sets the renewal
|
|
// period used to refresh periodic tokens
|
|
func WithRenewal(d time.Duration) Opts {
|
|
return func(v *vault) {
|
|
v.renew = d
|
|
}
|
|
}
|