-
Notifications
You must be signed in to change notification settings - Fork 0
/
option.go
36 lines (30 loc) · 686 Bytes
/
option.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package secfs
import (
"time"
)
// Option represents a functional Option
type Option func(*secfs)
// WithSecretPrefix configures a custom secret prefix
func WithSecretPrefix(x string) Option {
return func(s *secfs) {
s.prefix = x
}
}
// WithSecretSuffix configures a custom secret suffix
func WithSecretSuffix(x string) Option {
return func(s *secfs) {
s.suffix = x
}
}
// WithSecretLabels configures a custom secret labels
func WithSecretLabels(labels map[string]string) Option {
return func(s *secfs) {
s.labels = labels
}
}
// WithTimeout configures a custom request timeout
func WithTimeout(t time.Duration) Option {
return func(s *secfs) {
s.timeout = t
}
}