2018-09-21 22:03:34 +00:00
|
|
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// The protoc-gen-go-grpc binary is a protoc plugin to generate Go gRPC
|
|
|
|
// service definitions.
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-05-14 06:55:40 +00:00
|
|
|
"google.golang.org/protobuf/cmd/protoc-gen-go-grpc/internal_gengogrpc"
|
2019-05-14 19:44:37 +00:00
|
|
|
"google.golang.org/protobuf/compiler/protogen"
|
2018-09-21 22:03:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
protogen.Run(nil, func(gen *protogen.Plugin) error {
|
2019-02-28 05:46:29 +00:00
|
|
|
for _, f := range gen.Files {
|
|
|
|
if f.Generate {
|
|
|
|
internal_gengogrpc.GenerateFile(gen, f)
|
2018-09-21 22:03:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
}
|