Commit Graph

147 Commits

Author SHA1 Message Date
Joshua Humphries 18564ff61d
reflection: improve server implementation (#5197) 2022-02-18 13:13:23 -08:00
Eric Butler ebc30b8fc3
reflection: use protobuf/reflect instead of go reflection, fix dynamic messages (#5180) 2022-02-15 11:01:42 -08:00
赵延 c44f627fd1
cleanup: replace grpc.WithInsecure with insecure.NewCredentials (#5177) 2022-02-09 11:17:46 -08:00
Doug Fawley c285fc70e0
cmd/protoc-gen-go-grpc: update version for release (#5070) 2021-12-20 15:40:38 -08:00
Joshua Humphries 145f12a95b
reflection: accept interface instead of grpc.Server struct in Register() (#4340) 2021-04-27 13:15:08 -07:00
Aliaksandr Mianzhynski d6abfb4598
cmd/protoc-gen-go-grpc: add protoc and protoc-gen-go-grpc versions to top comment (#4313) 2021-04-09 16:30:59 -07:00
Doug Fawley 938f6e2f75
cmd/protoc-gen-go-grpc: add gRPC-Go version comment and update release version (#4152) 2021-01-14 14:28:25 -08:00
Edmond 8f3cc6cc26
protoc-gen-go-grpc: export grpc.ServiceDesc (#4035) 2020-11-23 14:56:57 -08:00
Timothy Gu 20636e76a9
protobuf: update protoc to latest version (#4038)
Presently, protoc 3.3.0 (released in 2017) is still being used. This
commit updates the vet.sh script as well as existing generated files to
use protoc 3.14.0 instead.

The only concrete change this brings is updated import paths of
Timestamp and Duration types. However, in practice this is a no-op,
since the types themselves are already aliased to the new import path:

- https://pkg.go.dev/github.com/golang/protobuf@v1.4.3/ptypes/duration#Duration
- https://pkg.go.dev/github.com/golang/protobuf@v1.4.3/ptypes/timestamp#Timestamp
2020-11-16 16:59:46 -08:00
Gaurav Gahlot d7a7a304ff
testing: Avoid using context.Background (#3949) 2020-11-05 09:25:17 -08:00
Doug Fawley 4e8458e5c6
protobuf: update all generated code to google.golang.org/protobuf (#3932) 2020-10-21 16:05:44 -07:00
Doug Fawley 9519efffeb
cmd/protoc-gen-go-grpc: use grpc.ServiceRegistrar instead of *grpc.Server (#3968) 2020-10-20 13:02:25 -07:00
Doug Fawley 02cd07d9bb
cmd/protoc-gen-go-grpc: revert to interface-based service registration (#3911) 2020-09-29 15:17:06 -07:00
Menghan Li 659b82911d
internal: regenerate pb.go (#3893) 2020-09-22 15:17:47 -07:00
Doug Fawley ff9dd65c90
protoc-gen-go-grpc: generate interfaces optionally; remove NewFooService (#3876) 2020-09-16 10:15:56 -07:00
Garrett Gutierrez 52029da148
service reflection: include transitive closure for a file (#3851) 2020-09-09 15:37:11 -07:00
Doug Fawley d31b671000
cmd/protoc-gen-go-grpc: call interceptor even if handler is unset (#3849) 2020-08-26 16:05:36 -07:00
Doug Fawley 44d73dff99
cmd/protoc-gen-go-grpc: rework service registration (#3828) 2020-08-25 09:28:01 -07:00
Doug Fawley ad51f572fd
protoc-gen-go-grpc: add requirement of embedding UnimplementedServer in services (#3657) 2020-06-04 10:56:13 -07:00
Damien Neil f818fd2a02
all: regenerate .pb.go files using cmd/protoc-gen-go-grpc (#3646)
Change regenerate.sh to use cmd/protoc-gen-go-grpc and rerun it.
This splits the gRPC service definitions into separate files, but
otherwise has no changes.
2020-05-28 13:52:49 -07:00
Damien Neil 15653fec60
all: refactor .pb.go generation (#3451)
Replace various //go:generate lines and regenerate.sh scripts with a
single, top-level regenerate.sh that regenerates all .pb.go files.

Placing generation in a single script ensures that all files are
generated with similar parameters. The new regenerate.sh uses the
protoc-gen-go version defined in test/tools/go.mod and automatically
handles new .proto files as they are added.

Do some minor refactoring on .proto files: Every file now has a
go_package option (which will be required by a future version of the
code generator), and file imports are all relative to the repository
root.
2020-04-24 08:54:03 -07:00
Doug Fawley 27096e8260
doc: update README for supported Go versions and travis for tests (#3516) 2020-04-10 16:01:05 -07:00
Garrett Gutierrez 132187f04c
Modified tests to use tlogger. (#3343)
* Modified tests to use tlogger.

* Fail on errors, with error expectations.

* Added expects and MixedCapsed grpclb_config tests

* Moved tlogger to grpctest, moved leakcheck tester to grpctest.go

* Added ExpectErrorN()

* Removed redundant leak checks

* Fixed new test

* Made tlogger globals into tlogger methods

* ErrorsLeft -> EndTest

* Removed some redundant lines

* Fixed error in test and empty map in EndTest
2020-02-06 13:03:20 -08:00
Doug Fawley b88d2d7465
protobuf: update protoc-gen-go version and generated code (#3345) 2020-01-30 10:23:21 -08:00
Menghan Li 5367efb805
cleanup: no x/net/context (#3120)
Manual change + mockgen
2019-10-29 13:06:26 -07:00
Doug Fawley df162eae76
test: embed Unimplemented___Server in every service (#3076) 2019-10-04 13:22:31 -07:00
Doug Fawley e2cfd1c28f
internal: update proto library version (#3025)
Also, two fixes:

- Fix long-standing `.travis.yml` bug where `VET_SKIP_PROTO` was not `export`ed (so not seen by `vet.sh`).
- Update `vet.sh` to work with new `goimports -l` that does not print a `:` after filenames.
2019-09-17 13:49:26 -07:00
Can Guler 29a7ac4deb
client: deprecates FailFast & replaces its use by WaitForReady. 2018-12-13 15:15:11 -08:00
Doug Fawley 04ea82009c
cleanup: replace "x/net/context" import with "context" (#2439) 2018-11-12 13:30:41 -08:00
lyuxuan 8e36593ad9 go generate: update proto files (#2236) 2018-07-25 11:40:12 -07:00
Menghan Li 39a411827d
internal: Update proto generated code (#2133) 2018-06-08 17:54:26 -07:00
Menghan Li f669235193
internal: update proto generated code (#2093) 2018-05-21 09:59:26 -07:00
lyuxuan a36eb4675a
regenerate *.pb.go files due to proto-gen-go update (#2070) 2018-05-11 18:57:54 -07:00
Menghan Li e538e04cad proto: update generated code (#2039) 2018-05-01 12:53:20 -07:00
Menghan Li 6e5192d28c
reflection: regenerate pb.go file after typo fix (#2002)
The typo in proto file was fixed, but not pg.go file. This was causing failures
in travis cron tests.
2018-04-17 09:46:15 -07:00
Karsten Weiss 7de9139327 Fix typos (#1994) 2018-04-16 10:03:02 -07:00
Joshua Humphries dfbefc6795 service reflection can lookup enum, enum val, oneof, and field symbols (#1910)
* service reflection can lookup enum, enum val, oneof, and field symbols; cache descriptors

* address feedback: don't use mutex, remove unnecessary conditional, make fileDescContainingExtension a func instead of a method
2018-03-21 16:49:57 -07:00
Gyu-Ho Lee 865013bc17 *: replace deprecated grpc.Errorf calls with status.Errorf (#1651) 2017-11-06 10:24:20 -08:00
Menghan Li 59cb69e66d Fix misspells (#1531) 2017-09-20 14:55:57 -07:00
Menghan Li 8233e124e4 Add new Resolver and Balancer APIs (gRFC L9) (#1408)
- Add package balancer and resolver.
 - Change ClientConn internals to new APIs and adds a wrapper for v1 balancer.
2017-08-31 10:59:09 -07:00
dfawley 25b4a426b4 go-generate pb.go files and check in Travis to make sure they don't change (#1426) 2017-08-17 16:00:51 -07:00
田欧 3c33c26290 add license for some proto files (#1322) 2017-06-27 09:54:34 -07:00
Menghan Li 1d797552ae Add support for grpc.SupportPackageIsVersion3 back (#1331)
* Support byte slice file descriptor as metadata and add SupportPackageIsVersion3 back

* add v3 test, generate testv3.pb.go with old codegen
2017-06-22 13:56:59 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Menghan Li a7fee9febf Use proto.Equal for equalities on Go proto messages (#1204) 2017-04-27 10:19:45 -07:00
Josh Humphries ba8cd6e3e6 fix FileContainingExtension in server reflection 2017-02-09 21:12:29 -05:00
Menghan Li dd61a2fa33 fix golint 2016-11-15 11:25:52 -08:00
Qi Zhao 777daa17ff Merge pull request #941 from MakMukhi/mmukhi_update_server_relection
update pre-generated code and server reflection code to comply with the change to the grpc g…
2016-11-03 16:04:21 -07:00
Gyu-Ho Lee 05aaecb59d reflection: check ServerReflectionInfo error 2016-10-28 22:37:37 -07:00
Mahak Mukhi 883bfc7bc8 pb.go file update 2016-10-28 12:37:56 -07:00
Mak Mukhi 5303e26e10 update reflection test pb.go 2016-10-21 18:20:12 -07:00
Mak Mukhi 727a60e4d1 update server reflection code to comply with the change to the grpc generator 2016-10-21 18:06:55 -07:00
Tamir Duberstein ac90a026b6
*: go vet 2016-07-27 23:39:19 -04:00
Menghan Li 42a2879989 Modify comments 2016-07-11 16:25:52 -07:00
Menghan Li bc8885608f Merge unary RPC info and streaming RPC info 2016-07-11 13:09:50 -07:00
Menghan Li 0ea9f970c0 Add StreamInfo for streaming types 2016-07-11 12:09:05 -07:00
Menghan Li a518fa911d Split methods and streams in service info 2016-07-11 12:09:05 -07:00
Menghan Li a6bacfe42c Fix go vet 2016-06-29 13:36:10 -07:00
Menghan Li e297a2401a Add import comments to package reflection 2016-06-28 17:46:18 -07:00
Menghan Li 26d2db5487 Add server.GetServiceInfo().
To replace server.ServiceMetadata() and server.AllServiceNames().
2016-06-27 12:01:05 -07:00
Menghan Li 439f11e63d Minor changes
Add copyright
Return proto.Marshal(fd)
Comments
2016-06-27 12:01:05 -07:00
Menghan Li 69c7425a21 Change server.ServiceMetadata to take service name and method name.
And some minor changes.
2016-06-27 12:01:05 -07:00
Menghan Li 1302eb9c41 Minor fixes 2016-06-27 12:01:05 -07:00
Menghan Li 451a2e416b Minor change in allExtensionNumbersForType(), add TestAllServiceNames() 2016-06-27 12:01:05 -07:00
Menghan Li 3fe1c5b241 Add readme 2016-06-27 12:01:05 -07:00
Menghan Li cb12010c86 Remove return value idxs []int from fileDescForType() 2016-06-27 12:01:05 -07:00
Menghan Li 99966b0e14 Remove t.Logf 2016-06-27 12:01:05 -07:00
Menghan Li 965636a9b1 Minor changes, comments and test error message 2016-06-27 12:01:05 -07:00
Menghan Li ffd3d5874a Add test for testListServices 2016-06-27 12:01:05 -07:00
Menghan Li 531771bfae Implement ServerReflectionRequest_ListServices 2016-06-27 12:01:05 -07:00
Menghan Li ab04d8e500 Add service symbol checking to testFileContainingSymbol 2016-06-27 12:01:05 -07:00
Menghan Li 29175df6c2 Update generated files in reflection 2016-06-27 12:01:05 -07:00
Menghan Li c26f2fb8f2 Remove TestFileDescWireFormatByFilename 2016-06-27 12:01:05 -07:00
Menghan Li 5f5c109f1d Add TestFileDescForType TestFileDescContainingExtension 2016-06-27 12:01:05 -07:00
Menghan Li 864c571f44 Remove mutex and cache 2016-06-27 12:01:05 -07:00
Menghan Li a5a4628ee4 Remove unused functions 2016-06-27 12:01:05 -07:00
Menghan Li 6bda8ed552 Add checking response in reflection end2end tests 2016-06-27 12:01:05 -07:00
Menghan Li c41121a259 Remove filenameToDescMap, replace with proto.FileDescriptor() 2016-06-27 12:01:05 -07:00
Menghan Li d7e74bbbb0 Update generated files in reflection 2016-06-27 12:01:05 -07:00
Menghan Li ae32a64fc3 Add end2end reflection tests frame, not checking response 2016-06-27 12:01:05 -07:00
Menghan Li 5d7d0ce3d3 Add returning unimplemented error to list_services 2016-06-27 12:01:05 -07:00
Menghan Li f28f4aa4bd Add allExtensionNumbersForTypeName and handle all_extension_numbers_response 2016-06-27 12:01:05 -07:00
Menghan Li 54fd6c1ea3 Create response at beginning and populate it with corresponding bytes 2016-06-27 12:01:05 -07:00
Menghan Li d578ccfa12 Add fileDescWireFormatContainingExtension and handle file_containing_extension 2016-06-27 12:01:05 -07:00
Menghan Li 36cfaed58e Add fileDescWireFormatContainingSymbol and handle file_containing_symbol 2016-06-27 12:01:05 -07:00
Menghan Li 273b7164b3 Change package name and add InstallOnServer() 2016-06-27 12:01:05 -07:00
Menghan Li ffca1d2bce Add fileDescWireFormatByFilename, and handle file_by_filename 2016-06-27 12:01:05 -07:00
Menghan Li 43e7db5352 Add ServerReflectionInfo handler, not implemented 2016-06-27 12:01:05 -07:00
Menghan Li 6bd4f6eb1e Add reflection.proto 2016-06-27 12:01:05 -07:00
Menghan Li 1be569e2d5 Make use of cache maps 2016-06-27 12:01:05 -07:00
Menghan Li 8c8bcdd402 Add allExtensionNumbersForType 2016-06-27 12:01:05 -07:00
Menghan Li 196c123058 Add fileDescContainingExtension 2016-06-27 12:01:05 -07:00
Menghan Li 2453898c6a Add proto2.proto and proto2_ext.proto 2016-06-27 12:01:05 -07:00
Menghan Li dd2c45bc03 Add filenameForType 2016-06-27 12:01:05 -07:00
Menghan Li 36cbb03cfe Add typeForName nameForType nameForPointer 2016-06-27 12:01:05 -07:00
Menghan Li 15469fce29 Add fileDescForType, tests to be added 2016-06-27 12:01:05 -07:00
Menghan Li 5144c679d0 Add testing proto 2016-06-27 12:01:05 -07:00