-
Notifications
You must be signed in to change notification settings - Fork 310
/
cluster.pb.setters.fm.go
54 lines (50 loc) · 1.14 KB
/
cluster.pb.setters.fm.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Code generated by protoc-gen-fieldmask. DO NOT EDIT.
package ttnpb
import fmt "fmt"
func (dst *PeerInfo) SetFields(src *PeerInfo, paths ...string) error {
for name, subs := range _processPaths(paths) {
switch name {
case "grpc_port":
if len(subs) > 0 {
return fmt.Errorf("'grpc_port' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.GRPCPort = src.GRPCPort
} else {
var zero uint32
dst.GRPCPort = zero
}
case "tls":
if len(subs) > 0 {
return fmt.Errorf("'tls' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.TLS = src.TLS
} else {
var zero bool
dst.TLS = zero
}
case "roles":
if len(subs) > 0 {
return fmt.Errorf("'roles' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Roles = src.Roles
} else {
dst.Roles = nil
}
case "tags":
if len(subs) > 0 {
return fmt.Errorf("'tags' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Tags = src.Tags
} else {
dst.Tags = nil
}
default:
return fmt.Errorf("invalid field: '%s'", name)
}
}
return nil
}