-
Notifications
You must be signed in to change notification settings - Fork 19
/
options.go
39 lines (32 loc) · 967 Bytes
/
options.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
37
38
39
package parser
import (
"github.com/cirruslabs/cirrus-cli/pkg/larker/fs"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
"google.golang.org/protobuf/reflect/protoreflect"
)
type Option func(*Parser)
func WithEnvironment(environment map[string]string) Option {
return func(parser *Parser) {
parser.environment = environment
}
}
func WithFileSystem(fs fs.FileSystem) Option {
return func(parser *Parser) {
parser.fs = fs
}
}
func WithAffectedFiles(affectedFiles []string) Option {
return func(parser *Parser) {
parser.affectedFiles = affectedFiles
}
}
func WithAdditionalInstances(additionalInstances map[string]protoreflect.MessageDescriptor) Option {
return func(parser *Parser) {
parser.additionalInstances = additionalInstances
}
}
func WithAdditionalTaskProperties(additionalTaskProperties []*descriptor.FieldDescriptorProto) Option {
return func(parser *Parser) {
parser.additionalTaskProperties = additionalTaskProperties
}
}