Commit Graph

18 Commits

Author SHA1 Message Date
Purnesh Dixit 070d9c793a
codes: replace %q to %d in error string when invalid code is an integer (#7188) 2024-05-09 09:11:37 -07:00
Doug Fawley cb3ae760e1
codes: update docstring to indicate expected usage (#6701) 2023-10-10 13:06:23 -07:00
Zach Reyes f69e9ad8d4
stats/opencensus: Add OpenCensus metrics support (#5923) 2023-02-06 20:00:14 -05:00
Kane York 34053813f1
codes: document which error codes can be returned by the framework (#3699)
This commit essentially copies the information from the second section of the gRPC core
documentation about status codes at
https://grpc.github.io/grpc/core/md_doc_statuscodes.html
into the Go documentation of the status codes, to increase visibility.
2020-07-09 13:32:33 -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
Jean de Klerk 9d8d97a245
docs: add note about retrying UNAVAILABLE (#2774) 2019-04-15 14:59:43 -06:00
Fabian Holler b94ea975f3 codes: fix: marshal/unmarshal a Code to JSON fails (#2116)
Marshalling a Code to JSON and unmarshalling it failed with an
"invalid code" error message.

Code is of type uint32. It has no custom MarshalJson() implemented
therefore it is marshalled into an JSON integer value.
The UnmarshalJSON() function expected that the marshalled Code is a
String type, unmarshalling failed.

Check in UnmarshalJSON() if the value is an uint32 in the range of the
defined Code values. If it is, unmarshal it.

This commit also adds an Marshal/Unmarshal testcase.
2018-06-01 10:56:55 -07:00
田欧 8a8ac82f1f update const order (#1770) 2018-01-04 15:44:29 -08:00
dfawley 2941ee12eb
codes: Add UnmarshalJSON support to Code type (#1720) 2017-12-11 09:02:19 -08:00
Menghan Li b8191e57b2
remove stringer and go generate (#1715) 2017-12-06 17:35:20 -08:00
Menghan Li b7dc71e7ea
Optimize codes.String() method using a switch instead of a slice of indexes (#1712) 2017-12-06 10:50:43 -08:00
dfawley c1fc29613d update code_string.go for new stringer changes (#1674)
To fix travis check failures
2017-11-14 15:20:10 -08: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
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Mehrdad Afshari 5e42b6f37e Fixed comment spelling (#1254) 2017-05-22 13:13:07 -07:00
Max Hawkins 972dbd2cb2 Run stringer on codes.Code
This makes error codes easier to read:
fmt.Sprint(codes.OK) == "OK" instead of "0"
2015-03-24 10:15:18 -07:00
David Symonds 3981839a52 Add import comments to grpc packages.
This enforces that these packages are used with these import paths.
See http://golang.org/cmd/go/#hdr-Import_path_checking for documentation.
2015-02-09 13:46:16 +11:00
David Symonds e71095e0ec Move source files up one level.
The top-level directory in this repository is going to be
the main "grpc" package.
2015-02-09 11:33:38 +11:00