edge/pkg/storage/share/shared_resource_options.go
William Petit 8e574c299b
All checks were successful
arcad/edge/pipeline/pr-master This commit looks good
feat(storage): rpc based implementation
2023-09-28 12:36:30 -06:00

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
}
}