2018-09-21 15:03:34 -07: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-13 23:55:40 -07:00
|
|
|
"google.golang.org/protobuf/cmd/protoc-gen-go-grpc/internal_gengogrpc"
|
2019-05-14 12:44:37 -07:00
|
|
|
"google.golang.org/protobuf/compiler/protogen"
|
2018-09-21 15:03:34 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
protogen.Run(nil, func(gen *protogen.Plugin) error {
|
2019-02-27 21:46:29 -08:00
|
|
|
for _, f := range gen.Files {
|
|
|
|
if f.Generate {
|
|
|
|
internal_gengogrpc.GenerateFile(gen, f)
|
2018-09-21 15:03:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
}
|