@@ -23,37 +23,46 @@ func GetOpts(opt ...Option) options {
23
23
// Option - how Options are passed as arguments
24
24
type Option func (* options )
25
25
26
+ // StorageBucketCredentialInfo defines the parameters to pass into the
27
+ // WithFilterWorkersByStorageBucketCredentialState option.
28
+ type StorageBucketCredentialInfo struct {
29
+ CredentialId string
30
+ Filters []FilterStorageBucketCredentialStateFn
31
+ }
32
+
26
33
// options = how options are represented
27
34
type options struct {
28
- withName string
29
- withPublicId string
30
- withDescription string
31
- withAddress string
32
- withLimit int
33
- withLiveness time.Duration
34
- withUpdateTags bool
35
- withWorkerTags []* Tag
36
- withWorkerKeyIdentifier string
37
- withWorkerKeys WorkerKeys
38
- withControllerEncryptionPrivateKey []byte
39
- withKeyId string
40
- withNonce []byte
41
- withNewIdFunc func (context.Context ) (string , error )
42
- WithFetchNodeCredentialsRequest * types.FetchNodeCredentialsRequest
43
- withTestPkiWorkerAuthorized bool
44
- withTestPkiWorkerKeyId * string
45
- withTestUseInputTagsAsApiTags bool
46
- withWorkerType WorkerType
47
- withRoot RootInfo
48
- withStopAfter uint
49
- WithCreateControllerLedActivationToken bool
50
- withReleaseVersion string
51
- withOperationalState string
52
- withLocalStorageState string
53
- withActiveWorkers bool
54
- withFeature version.Feature
55
- withDirectlyConnected bool
56
- withWorkerPool []string
35
+ withName string
36
+ withPublicId string
37
+ withDescription string
38
+ withAddress string
39
+ withLimit int
40
+ withLiveness time.Duration
41
+ withUpdateTags bool
42
+ withWorkerTags []* Tag
43
+ withWorkerKeyIdentifier string
44
+ withWorkerKeys WorkerKeys
45
+ withControllerEncryptionPrivateKey []byte
46
+ withKeyId string
47
+ withNonce []byte
48
+ withNewIdFunc func (context.Context ) (string , error )
49
+ WithFetchNodeCredentialsRequest * types.FetchNodeCredentialsRequest
50
+ withTestPkiWorkerAuthorized bool
51
+ withTestPkiWorkerKeyId * string
52
+ withTestUseInputTagsAsApiTags bool
53
+ withWorkerType WorkerType
54
+ withRoot RootInfo
55
+ withStopAfter uint
56
+ WithCreateControllerLedActivationToken bool
57
+ withReleaseVersion string
58
+ withOperationalState string
59
+ withLocalStorageState string
60
+ withActiveWorkers bool
61
+ withFeature version.Feature
62
+ withDirectlyConnected bool
63
+ withWorkerPool []string
64
+ withFilterWorkersByStorageBucketCredentialState * StorageBucketCredentialInfo
65
+ withFilterWorkersByLocalStorageState bool
57
66
}
58
67
59
68
func getDefaultOptions () options {
@@ -276,3 +285,21 @@ func WithLocalStorageState(state string) Option {
276
285
o .withLocalStorageState = state
277
286
}
278
287
}
288
+
289
+ // WithFilterWorkersByStorageBucketCredentialState receives a storage bucket
290
+ // credential id and filters to apply and calls
291
+ // FilterWorkersByStorageBucketCredentialState in supported repository
292
+ // functions.
293
+ func WithFilterWorkersByStorageBucketCredentialState (ci * StorageBucketCredentialInfo ) Option {
294
+ return func (o * options ) {
295
+ o .withFilterWorkersByStorageBucketCredentialState = ci
296
+ }
297
+ }
298
+
299
+ // WithFilterWorkersByLocalStorageState controls whether
300
+ // FilterWorkersByLocalStorageState is called in supported repository functions.
301
+ func WithFilterWorkersByLocalStorageState (filter bool ) Option {
302
+ return func (o * options ) {
303
+ o .withFilterWorkersByLocalStorageState = filter
304
+ }
305
+ }
0 commit comments