forked from moby/swarmkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
31 lines (27 loc) · 840 Bytes
/
main.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
package main
import (
_ "github.com/docker/swarmkit/protobuf/plugin/authenticatedwrapper"
_ "github.com/docker/swarmkit/protobuf/plugin/deepcopy"
_ "github.com/docker/swarmkit/protobuf/plugin/raftproxy"
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
"github.com/gogo/protobuf/vanity/command"
)
func main() {
req := command.Read()
files := req.GetProtoFile()
files = vanity.FilterFiles(files, vanity.NotInPackageGoogleProtobuf)
for _, opt := range []func(*descriptor.FileDescriptorProto){
vanity.TurnOnGoStringAll,
vanity.TurnOffGoGettersAll,
vanity.TurnOffGoStringerAll,
vanity.TurnOnMarshalerAll,
vanity.TurnOnStringerAll,
vanity.TurnOnUnmarshalerAll,
vanity.TurnOnSizerAll,
} {
vanity.ForEachFile(files, opt)
}
resp := command.Generate(req)
command.Write(resp)
}