Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | package descriptor
|
| 2 |
|
| 3 | import (
|
| 4 | "github.com/golang/protobuf/proto"
|
| 5 | "google.golang.org/genproto/googleapis/api/annotations"
|
| 6 | )
|
| 7 |
|
| 8 | // GrpcAPIService represents a stripped down version of google.api.Service .
|
| 9 | // Compare to https://github.com/googleapis/googleapis/blob/master/google/api/service.proto
|
| 10 | // The original imports 23 other protobuf files we are not interested in. If a significant
|
| 11 | // subset (>50%) of these start being reproduced in this file we should swap to using the
|
| 12 | // full generated version instead.
|
| 13 | //
|
| 14 | // For the purposes of the gateway generator we only consider a small subset of all
|
| 15 | // available features google supports in their service descriptions. Thanks to backwards
|
| 16 | // compatibility guarantees by protobuf it is safe for us to remove the other fields.
|
| 17 | // We also only implement the absolute minimum of protobuf generator boilerplate to use
|
| 18 | // our simplified version. These should be pretty stable too.
|
| 19 | type GrpcAPIService struct {
|
| 20 | // Http Rule. Named Http in the actual proto. Changed to suppress linter warning.
|
| 21 | HTTP *annotations.Http `protobuf:"bytes,9,opt,name=http" json:"http,omitempty"`
|
| 22 | }
|
| 23 |
|
| 24 | // ProtoMessage returns an empty GrpcAPIService element
|
| 25 | func (*GrpcAPIService) ProtoMessage() {}
|
| 26 |
|
| 27 | // Reset resets the GrpcAPIService
|
| 28 | func (m *GrpcAPIService) Reset() { *m = GrpcAPIService{} }
|
| 29 |
|
| 30 | // String returns the string representation of the GrpcAPIService
|
| 31 | func (m *GrpcAPIService) String() string { return proto.CompactTextString(m) }
|