William Petit
8e574c299b
All checks were successful
arcad/edge/pipeline/pr-master This commit looks good
31 lines
593 B
Go
31 lines
593 B
Go
package share
|
|
|
|
type FindResourcesOptionFunc func(*FindResourcesOptions)
|
|
|
|
type FindResourcesOptions struct {
|
|
Name *string
|
|
ValueType *ValueType
|
|
}
|
|
|
|
func NewFindResourcesOptions(funcs ...FindResourcesOptionFunc) *FindResourcesOptions {
|
|
opts := &FindResourcesOptions{}
|
|
|
|
for _, fn := range funcs {
|
|
fn(opts)
|
|
}
|
|
|
|
return opts
|
|
}
|
|
|
|
func WithName(name string) FindResourcesOptionFunc {
|
|
return func(opts *FindResourcesOptions) {
|
|
opts.Name = &name
|
|
}
|
|
}
|
|
|
|
func WithType(valueType ValueType) FindResourcesOptionFunc {
|
|
return func(opts *FindResourcesOptions) {
|
|
opts.ValueType = &valueType
|
|
}
|
|
}
|