mirror of https://github.com/knative/caching.git
upgrade to latest dependencies
bumping google.golang.org/grpc d0bf90a...6f50403: > 6f50403 Change version to 1.67.0 (# 7604) > 3c3a025 mem: replace flate.Reader reference (# 7595) (# 7637) > 3ffb98b .*: fix revive lints `redefines-builtin-id` (# 7552) > 5666049 vet: enforce revive linter (# 7589) > c6ad07f protoc: regenerate protos (# 7590) > 70f19ee credentials/tls: default GRPC_ENFORCE_ALPN_ENABLED to true (# 7535) > 92111dc xds: keep ads flow control local to xdsclient/transport package (# 7578) > 535bdce estats: remove dependency on testing package (# 7579) > 0f03c74 .*: fix revive lint issues `unused-parameter` (# 7580) > 6147c81 stats/opentelemetry: Optimize slice allocations (# 7525) > cd05c9e .*: fix revive package-comments lint issues (# 7574) > 00514a7 xds/clusterimpl: update UpdateClientConnState to handle updates synchronously (# 7533) > 093e099 grpc: fix regression by freeing request bufferslice after processing unary (# 7571) > 8320224 .*: revive from unused_parameters (# 7577) > 845f62c stats/otel: upgrade grpc version that contains the experimental/stats package (# 7545) > 55d820d clusterresolver/e2e_test: Avoid making DNS requests (# 7561) > 52961f7 grpc: add docs for generic stream interfaces (# 7470) > 005b092 examples/advancedtls: example code for different security configurations for grpc-go using `advancedtls` (# 7474) > 0b6f354 xdsclient: Populate total_issued_requests count in LRS load reports (# 7544) > c535946 grpc: Fix flaky picker_wrapper tests (# 7560) > 9feed00 balancer/wrr: prefer calling Equal() method of time.Time (# 7529) > a8e6e11 .*: Use `strings.ReplaceAll(.....)` (# 7554) > 6d97688 xds/xdsclient: Fix flaky test TestLRSClient (# 7559) > cfd14ba encoding: delete v1 proto codec and use one map for registry (# 7557) > 3d95421 Fix revive identified linter issues: var-declaration, indent-error-flow, increment-decrement, superfluous-else (# 7528) > e4b09f1 Remove trailing whitespace in testing.yml (# 7551) > 0a5b8f7 balancer: disallow producer streams until SubConn has reported READY (# 7523) > 9ab8b62 Implement new Codec that uses `mem.BufferSlice` instead of `[]byte` (# 7356) > 7e12068 bootstrap: add `String` method to ServerConfigs type (# 7537) > ee5cbce ringhash: fix bug where ring hash can be stuck in transient failure despite having available endpoints (# 7364) > 1e2bb71 doc: update keepalive ClientParameters doc about doubling the interval upon GOAWAY (# 7469) > 6a5a283 Use builtin min and max functions (# 7478) > 90caeb3 deps: update dependencies for all modules (# 7531) > f8d98a4 rbac: fix usage of AuthInfo (# 7522) > 4e29cc6 transport: add timeout for writing GOAWAY on http2Client.Close() (# 7371) > b45fc41 Change version to 1.67.0-dev (# 7520) bumping google.golang.org/genproto/googleapis/rpc 573a115...ddb44da: > ddb44da chore: update to 1.21 (# 1152) > 8ffd90a chore(all): auto-regenerate .pb.go files (# 1150) bumping knative.dev/pkg aaab500...aabe552: > aabe552 Bump google.golang.org/grpc from 1.66.2 to 1.67.0 (# 3094) > a4774ed Bump github.com/gobuffalo/flect from 1.0.2 to 1.0.3 (# 3093) bumping google.golang.org/genproto/googleapis/api 573a115...ddb44da: > ddb44da chore: update to 1.21 (# 1152) > 8ffd90a chore(all): auto-regenerate .pb.go files (# 1150) Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
b5ae36e21a
commit
f408e736ca
8
go.mod
8
go.mod
|
@ -11,7 +11,7 @@ require (
|
|||
k8s.io/code-generator v0.30.3
|
||||
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8
|
||||
knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d
|
||||
knative.dev/pkg v0.0.0-20240917091217-aaab500c26c4
|
||||
knative.dev/pkg v0.0.0-20240923063442-aabe552ba5e6
|
||||
)
|
||||
|
||||
require (
|
||||
|
@ -67,9 +67,9 @@ require (
|
|||
golang.org/x/tools v0.25.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/api v0.183.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240808171019-573a1156607a // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a // indirect
|
||||
google.golang.org/grpc v1.66.2 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
google.golang.org/grpc v1.67.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
|
16
go.sum
16
go.sum
|
@ -580,10 +580,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
|
|||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240808171019-573a1156607a h1:KyUe15n7B1YCu+kMmPtlXxgkLQbp+Dw0tCRZf9Sd+CE=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240808171019-573a1156607a/go.mod h1:4+X6GvPs+25wZKbQq9qyAXrwIRExv7w0Ea6MgZLZiDM=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a h1:EKiZZXueP9/T68B8Nl0GAx9cjbQnCId0yP3qPMgaaHs=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
|
@ -597,8 +597,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
|
|||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
|
||||
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
|
||||
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
|
@ -664,8 +664,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
|
|||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d h1:mgROhGJG3+g0SBkaG4Y2HxrIOLN3ZZcN4+IFZla+Zqs=
|
||||
knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
|
||||
knative.dev/pkg v0.0.0-20240917091217-aaab500c26c4 h1:1yMPCa3CnWH8darWwC3YxBJC19ZvE/XNA4RtNnxKPDM=
|
||||
knative.dev/pkg v0.0.0-20240917091217-aaab500c26c4/go.mod h1:ZK0e9aChRwXJCpT8cypwvn/bJYTo6ygmyjiaz0E32EY=
|
||||
knative.dev/pkg v0.0.0-20240923063442-aabe552ba5e6 h1:3x7jZIppPg3PYUPq+tMUdfW1BIz1Do7Y/gWopZZKfg8=
|
||||
knative.dev/pkg v0.0.0-20240923063442-aabe552ba5e6/go.mod h1:IQi7fVFvQa6UpNnSpzlAiNPMtTvIj4MHj4vSD/PulCE=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
|
|
@ -36,7 +36,7 @@ type baseBuilder struct {
|
|||
config Config
|
||||
}
|
||||
|
||||
func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer {
|
||||
func (bb *baseBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer {
|
||||
bal := &baseBalancer{
|
||||
cc: cc,
|
||||
pickerBuilder: bb.pickerBuilder,
|
||||
|
@ -259,6 +259,6 @@ type errPicker struct {
|
|||
err error // Pick() always returns this err.
|
||||
}
|
||||
|
||||
func (p *errPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) {
|
||||
func (p *errPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) {
|
||||
return balancer.PickResult{}, p.err
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ const (
|
|||
|
||||
type pickfirstBuilder struct{}
|
||||
|
||||
func (pickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer {
|
||||
func (pickfirstBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer {
|
||||
b := &pickfirstBalancer{cc: cc}
|
||||
b.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(logPrefix, b))
|
||||
return b
|
||||
|
|
|
@ -192,7 +192,7 @@ func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer
|
|||
return acbw, nil
|
||||
}
|
||||
|
||||
func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) {
|
||||
func (ccb *ccBalancerWrapper) RemoveSubConn(balancer.SubConn) {
|
||||
// The graceful switch balancer will never call this.
|
||||
logger.Errorf("ccb RemoveSubConn(%v) called unexpectedly, sc")
|
||||
}
|
||||
|
@ -342,8 +342,8 @@ func (acbw *acBalancerWrapper) GetOrBuildProducer(pb balancer.ProducerBuilder) (
|
|||
pData := acbw.producers[pb]
|
||||
if pData == nil {
|
||||
// Not found; create a new one and add it to the producers map.
|
||||
p, close := pb.Build(acbw)
|
||||
pData = &refCountedProducer{producer: p, close: close}
|
||||
p, closeFn := pb.Build(acbw)
|
||||
pData = &refCountedProducer{producer: p, close: closeFn}
|
||||
acbw.producers[pb] = pData
|
||||
}
|
||||
// Account for this new reference.
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v5.27.1
|
||||
// source: grpc/binlog/v1/binarylog.proto
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ func file_grpc_binlog_v1_binarylog_proto_rawDescGZIP() []byte {
|
|||
|
||||
var file_grpc_binlog_v1_binarylog_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
||||
var file_grpc_binlog_v1_binarylog_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_grpc_binlog_v1_binarylog_proto_goTypes = []interface{}{
|
||||
var file_grpc_binlog_v1_binarylog_proto_goTypes = []any{
|
||||
(GrpcLogEntry_EventType)(0), // 0: grpc.binarylog.v1.GrpcLogEntry.EventType
|
||||
(GrpcLogEntry_Logger)(0), // 1: grpc.binarylog.v1.GrpcLogEntry.Logger
|
||||
(Address_Type)(0), // 2: grpc.binarylog.v1.Address.Type
|
||||
|
@ -1058,7 +1058,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*GrpcLogEntry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1070,7 +1070,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ClientHeader); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1082,7 +1082,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ServerHeader); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1094,7 +1094,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Trailer); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1106,7 +1106,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Message); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1118,7 +1118,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Metadata); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1130,7 +1130,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*MetadataEntry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1142,7 +1142,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Address); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -1155,7 +1155,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() {
|
|||
}
|
||||
}
|
||||
}
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
file_grpc_binlog_v1_binarylog_proto_msgTypes[0].OneofWrappers = []any{
|
||||
(*GrpcLogEntry_ClientHeader)(nil),
|
||||
(*GrpcLogEntry_ServerHeader)(nil),
|
||||
(*GrpcLogEntry_Message)(nil),
|
||||
|
|
|
@ -40,7 +40,7 @@ func NewCredentials() credentials.TransportCredentials {
|
|||
// NoSecurity.
|
||||
type insecureTC struct{}
|
||||
|
||||
func (insecureTC) ClientHandshake(ctx context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) {
|
||||
func (insecureTC) ClientHandshake(_ context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) {
|
||||
return conn, info{credentials.CommonAuthInfo{SecurityLevel: credentials.NoSecurity}}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -518,6 +518,8 @@ func WithUserAgent(s string) DialOption {
|
|||
|
||||
// WithKeepaliveParams returns a DialOption that specifies keepalive parameters
|
||||
// for the client transport.
|
||||
//
|
||||
// Keepalive is disabled by default.
|
||||
func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption {
|
||||
if kp.Time < internal.KeepaliveMinPingTime {
|
||||
logger.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime)
|
||||
|
|
|
@ -81,7 +81,7 @@ func (l *LoggerWrapper) Errorf(format string, args ...any) {
|
|||
}
|
||||
|
||||
// V reports whether verbosity level l is at least the requested verbose level.
|
||||
func (*LoggerWrapper) V(l int) bool {
|
||||
func (*LoggerWrapper) V(int) bool {
|
||||
// Returns true for all verbose level.
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v5.27.1
|
||||
// source: grpc/health/v1/health.proto
|
||||
|
||||
|
@ -237,7 +237,7 @@ func file_grpc_health_v1_health_proto_rawDescGZIP() []byte {
|
|||
|
||||
var file_grpc_health_v1_health_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_grpc_health_v1_health_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_grpc_health_v1_health_proto_goTypes = []interface{}{
|
||||
var file_grpc_health_v1_health_proto_goTypes = []any{
|
||||
(HealthCheckResponse_ServingStatus)(0), // 0: grpc.health.v1.HealthCheckResponse.ServingStatus
|
||||
(*HealthCheckRequest)(nil), // 1: grpc.health.v1.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 2: grpc.health.v1.HealthCheckResponse
|
||||
|
@ -261,7 +261,7 @@ func file_grpc_health_v1_health_proto_init() {
|
|||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_grpc_health_v1_health_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_health_v1_health_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HealthCheckRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -273,7 +273,7 @@ func file_grpc_health_v1_health_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_grpc_health_v1_health_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_grpc_health_v1_health_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HealthCheckResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
|
|
@ -106,7 +106,7 @@ func (ml *TruncatingMethodLogger) Build(c LogEntryConfig) *binlogpb.GrpcLogEntry
|
|||
}
|
||||
|
||||
// Log creates a proto binary log entry, and logs it to the sink.
|
||||
func (ml *TruncatingMethodLogger) Log(ctx context.Context, c LogEntryConfig) {
|
||||
func (ml *TruncatingMethodLogger) Log(_ context.Context, c LogEntryConfig) {
|
||||
ml.sink.Write(ml.Build(c))
|
||||
}
|
||||
|
||||
|
|
|
@ -234,13 +234,6 @@ func copyMap(m map[int64]string) map[int64]string {
|
|||
return n
|
||||
}
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (c *channelMap) getTopChannels(id int64, maxResults int) ([]*Channel, bool) {
|
||||
if maxResults <= 0 {
|
||||
maxResults = EntriesPerPage
|
||||
|
|
|
@ -33,7 +33,7 @@ var (
|
|||
// outside this package except by tests.
|
||||
IDGen IDGenerator
|
||||
|
||||
db *channelMap = newChannelMap()
|
||||
db = newChannelMap()
|
||||
// EntriesPerPage defines the number of channelz entries to be shown on a web page.
|
||||
EntriesPerPage = 50
|
||||
curState int32
|
||||
|
|
|
@ -35,13 +35,13 @@ type SocketOptionData struct {
|
|||
// Getsockopt defines the function to get socket options requested by channelz.
|
||||
// It is to be passed to syscall.RawConn.Control().
|
||||
// Windows OS doesn't support Socket Option
|
||||
func (s *SocketOptionData) Getsockopt(fd uintptr) {
|
||||
func (s *SocketOptionData) Getsockopt(uintptr) {
|
||||
once.Do(func() {
|
||||
logger.Warning("Channelz: socket options are not supported on non-linux environments")
|
||||
})
|
||||
}
|
||||
|
||||
// GetSocketOption gets the socket option info of the conn.
|
||||
func GetSocketOption(c any) *SocketOptionData {
|
||||
func GetSocketOption(any) *SocketOptionData {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ var (
|
|||
// option is present for backward compatibility. This option may be overridden
|
||||
// by setting the environment variable "GRPC_ENFORCE_ALPN_ENABLED" to "true"
|
||||
// or "false".
|
||||
EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", false)
|
||||
EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", true)
|
||||
// XDSFallbackSupport is the env variable that controls whether support for
|
||||
// xDS fallback is turned on. If this is unset or is false, only the first
|
||||
// xDS server in the list of server configs will be used.
|
||||
|
|
|
@ -183,7 +183,7 @@ var (
|
|||
|
||||
// GRPCResolverSchemeExtraMetadata determines when gRPC will add extra
|
||||
// metadata to RPCs.
|
||||
GRPCResolverSchemeExtraMetadata string = "xds"
|
||||
GRPCResolverSchemeExtraMetadata = "xds"
|
||||
|
||||
// EnterIdleModeForTesting gets the ClientConn to enter IDLE mode.
|
||||
EnterIdleModeForTesting any // func(*grpc.ClientConn)
|
||||
|
@ -203,7 +203,7 @@ var (
|
|||
|
||||
// UserSetDefaultScheme is set to true if the user has overridden the
|
||||
// default resolver scheme.
|
||||
UserSetDefaultScheme bool = false
|
||||
UserSetDefaultScheme = false
|
||||
|
||||
// ShuffleAddressListForTesting pseudo-randomizes the order of addresses. n
|
||||
// is the number of elements. swap swaps the elements with indexes i and j.
|
||||
|
|
|
@ -55,7 +55,7 @@ func (r *passthroughResolver) start() {
|
|||
r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint()}}})
|
||||
}
|
||||
|
||||
func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOptions) {}
|
||||
func (*passthroughResolver) ResolveNow(resolver.ResolveNowOptions) {}
|
||||
|
||||
func (*passthroughResolver) Close() {}
|
||||
|
||||
|
|
|
@ -138,11 +138,11 @@ func (s *Status) WithDetails(details ...protoadapt.MessageV1) (*Status, error) {
|
|||
// s.Code() != OK implies that s.Proto() != nil.
|
||||
p := s.Proto()
|
||||
for _, detail := range details {
|
||||
any, err := anypb.New(protoadapt.MessageV2Of(detail))
|
||||
m, err := anypb.New(protoadapt.MessageV2Of(detail))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p.Details = append(p.Details, any)
|
||||
p.Details = append(p.Details, m)
|
||||
}
|
||||
return &Status{s: p}, nil
|
||||
}
|
||||
|
|
|
@ -58,20 +58,20 @@ func GetRusage() *Rusage {
|
|||
|
||||
// CPUTimeDiff returns the differences of user CPU time and system CPU time used
|
||||
// between two Rusage structs. It a no-op function for non-linux environments.
|
||||
func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
|
||||
func CPUTimeDiff(*Rusage, *Rusage) (float64, float64) {
|
||||
log()
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
// SetTCPUserTimeout is a no-op function under non-linux environments.
|
||||
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
|
||||
func SetTCPUserTimeout(net.Conn, time.Duration) error {
|
||||
log()
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetTCPUserTimeout is a no-op function under non-linux environments.
|
||||
// A negative return value indicates the operation is not supported
|
||||
func GetTCPUserTimeout(conn net.Conn) (int, error) {
|
||||
func GetTCPUserTimeout(net.Conn) (int, error) {
|
||||
log()
|
||||
return -1, nil
|
||||
}
|
||||
|
|
|
@ -1033,10 +1033,3 @@ func (l *loopyWriter) processData() (bool, error) {
|
|||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
|
|
@ -333,7 +333,7 @@ func (ht *serverHandlerTransport) writeCustomHeaders(s *Stream) {
|
|||
s.hdrMu.Unlock()
|
||||
}
|
||||
|
||||
func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error {
|
||||
func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data mem.BufferSlice, _ *Options) error {
|
||||
// Always take a reference because otherwise there is no guarantee the data will
|
||||
// be available after this function returns. This is what callers to Write
|
||||
// expect.
|
||||
|
@ -475,7 +475,7 @@ func (ht *serverHandlerTransport) IncrMsgSent() {}
|
|||
|
||||
func (ht *serverHandlerTransport) IncrMsgRecv() {}
|
||||
|
||||
func (ht *serverHandlerTransport) Drain(debugData string) {
|
||||
func (ht *serverHandlerTransport) Drain(string) {
|
||||
panic("Drain() is not implemented")
|
||||
}
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream,
|
|||
hdr := &headerFrame{
|
||||
hf: headerFields,
|
||||
endStream: false,
|
||||
initStream: func(id uint32) error {
|
||||
initStream: func(uint32) error {
|
||||
t.mu.Lock()
|
||||
// TODO: handle transport closure in loopy instead and remove this
|
||||
// initStream is never called when transport is draining.
|
||||
|
@ -1667,11 +1667,10 @@ func (t *http2Client) reader(errCh chan<- error) {
|
|||
t.closeStream(s, status.Error(code, msg), true, http2.ErrCodeProtocol, status.New(code, msg), nil, false)
|
||||
}
|
||||
continue
|
||||
} else {
|
||||
// Transport error.
|
||||
t.Close(connectionErrorf(true, err, "error reading from server: %v", err))
|
||||
return
|
||||
}
|
||||
// Transport error.
|
||||
t.Close(connectionErrorf(true, err, "error reading from server: %v", err))
|
||||
return
|
||||
}
|
||||
switch frame := frame.(type) {
|
||||
case *http2.MetaHeadersFrame:
|
||||
|
@ -1696,13 +1695,6 @@ func (t *http2Client) reader(errCh chan<- error) {
|
|||
}
|
||||
}
|
||||
|
||||
func minTime(a, b time.Duration) time.Duration {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// keepalive running in a separate goroutine makes sure the connection is alive by sending pings.
|
||||
func (t *http2Client) keepalive() {
|
||||
p := &ping{data: [8]byte{}}
|
||||
|
@ -1770,7 +1762,7 @@ func (t *http2Client) keepalive() {
|
|||
// timeoutLeft. This will ensure that we wait only for kp.Time
|
||||
// before sending out the next ping (for cases where the ping is
|
||||
// acked).
|
||||
sleepDuration := minTime(t.kp.Time, timeoutLeft)
|
||||
sleepDuration := min(t.kp.Time, timeoutLeft)
|
||||
timeoutLeft -= sleepDuration
|
||||
timer.Reset(sleepDuration)
|
||||
case <-t.ctx.Done():
|
||||
|
|
|
@ -1117,7 +1117,7 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
|
|||
|
||||
// Write converts the data into HTTP2 data frame and sends it out. Non-nil error
|
||||
// is returns if it fails (e.g., framing error, transport error).
|
||||
func (t *http2Server) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error {
|
||||
func (t *http2Server) Write(s *Stream, hdr []byte, data mem.BufferSlice, _ *Options) error {
|
||||
reader := data.Reader()
|
||||
|
||||
if !s.isHeaderSent() { // Headers haven't been written yet.
|
||||
|
@ -1238,7 +1238,7 @@ func (t *http2Server) keepalive() {
|
|||
// timeoutLeft. This will ensure that we wait only for kp.Time
|
||||
// before sending out the next ping (for cases where the ping is
|
||||
// acked).
|
||||
sleepDuration := minTime(t.kp.Time, kpTimeoutLeft)
|
||||
sleepDuration := min(t.kp.Time, kpTimeoutLeft)
|
||||
kpTimeoutLeft -= sleepDuration
|
||||
kpTimer.Reset(sleepDuration)
|
||||
case <-t.done:
|
||||
|
|
|
@ -393,7 +393,7 @@ type framer struct {
|
|||
fr *http2.Framer
|
||||
}
|
||||
|
||||
var writeBufferPoolMap map[int]*sync.Pool = make(map[int]*sync.Pool)
|
||||
var writeBufferPoolMap = make(map[int]*sync.Pool)
|
||||
var writeBufferMutex sync.Mutex
|
||||
|
||||
func newFramer(conn net.Conn, writeBufferSize, readBufferSize int, sharedWriteBuffer bool, maxHeaderListSize uint32) *framer {
|
||||
|
|
|
@ -34,15 +34,29 @@ type ClientParameters struct {
|
|||
// After a duration of this time if the client doesn't see any activity it
|
||||
// pings the server to see if the transport is still alive.
|
||||
// If set below 10s, a minimum value of 10s will be used instead.
|
||||
Time time.Duration // The current default value is infinity.
|
||||
//
|
||||
// Note that gRPC servers have a default EnforcementPolicy.MinTime of 5
|
||||
// minutes (which means the client shouldn't ping more frequently than every
|
||||
// 5 minutes).
|
||||
//
|
||||
// Though not ideal, it's not a strong requirement for Time to be less than
|
||||
// EnforcementPolicy.MinTime. Time will automatically double if the server
|
||||
// disconnects due to its enforcement policy.
|
||||
//
|
||||
// For more details, see
|
||||
// https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
|
||||
Time time.Duration
|
||||
// After having pinged for keepalive check, the client waits for a duration
|
||||
// of Timeout and if no activity is seen even after that the connection is
|
||||
// closed.
|
||||
Timeout time.Duration // The current default value is 20 seconds.
|
||||
//
|
||||
// If keepalive is enabled, and this value is not explicitly set, the default
|
||||
// is 20 seconds.
|
||||
Timeout time.Duration
|
||||
// If true, client sends keepalive pings even with no active RPCs. If false,
|
||||
// when there are no active RPCs, Time and Timeout will be ignored and no
|
||||
// keepalive pings will be sent.
|
||||
PermitWithoutStream bool // false by default.
|
||||
PermitWithoutStream bool
|
||||
}
|
||||
|
||||
// ServerParameters is used to set keepalive and max-age parameters on the
|
||||
|
|
|
@ -224,11 +224,11 @@ func (e emptyBuffer) Len() int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (e emptyBuffer) split(n int) (left, right Buffer) {
|
||||
func (e emptyBuffer) split(int) (left, right Buffer) {
|
||||
return e, e
|
||||
}
|
||||
|
||||
func (e emptyBuffer) read(buf []byte) (int, Buffer) {
|
||||
func (e emptyBuffer) read([]byte) (int, Buffer) {
|
||||
return 0, e
|
||||
}
|
||||
|
||||
|
|
|
@ -220,8 +220,8 @@ type HeaderCallOption struct {
|
|||
HeaderAddr *metadata.MD
|
||||
}
|
||||
|
||||
func (o HeaderCallOption) before(c *callInfo) error { return nil }
|
||||
func (o HeaderCallOption) after(c *callInfo, attempt *csAttempt) {
|
||||
func (o HeaderCallOption) before(*callInfo) error { return nil }
|
||||
func (o HeaderCallOption) after(_ *callInfo, attempt *csAttempt) {
|
||||
*o.HeaderAddr, _ = attempt.s.Header()
|
||||
}
|
||||
|
||||
|
@ -242,8 +242,8 @@ type TrailerCallOption struct {
|
|||
TrailerAddr *metadata.MD
|
||||
}
|
||||
|
||||
func (o TrailerCallOption) before(c *callInfo) error { return nil }
|
||||
func (o TrailerCallOption) after(c *callInfo, attempt *csAttempt) {
|
||||
func (o TrailerCallOption) before(*callInfo) error { return nil }
|
||||
func (o TrailerCallOption) after(_ *callInfo, attempt *csAttempt) {
|
||||
*o.TrailerAddr = attempt.s.Trailer()
|
||||
}
|
||||
|
||||
|
@ -264,8 +264,8 @@ type PeerCallOption struct {
|
|||
PeerAddr *peer.Peer
|
||||
}
|
||||
|
||||
func (o PeerCallOption) before(c *callInfo) error { return nil }
|
||||
func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) {
|
||||
func (o PeerCallOption) before(*callInfo) error { return nil }
|
||||
func (o PeerCallOption) after(_ *callInfo, attempt *csAttempt) {
|
||||
if x, ok := peer.FromContext(attempt.s.Context()); ok {
|
||||
*o.PeerAddr = *x
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ func (o FailFastCallOption) before(c *callInfo) error {
|
|||
c.failFast = o.FailFast
|
||||
return nil
|
||||
}
|
||||
func (o FailFastCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o FailFastCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// OnFinish returns a CallOption that configures a callback to be called when
|
||||
// the call completes. The error passed to the callback is the status of the
|
||||
|
@ -339,7 +339,7 @@ func (o OnFinishCallOption) before(c *callInfo) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (o OnFinishCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o OnFinishCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// MaxCallRecvMsgSize returns a CallOption which sets the maximum message size
|
||||
// in bytes the client can receive. If this is not set, gRPC uses the default
|
||||
|
@ -363,7 +363,7 @@ func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error {
|
|||
c.maxReceiveMessageSize = &o.MaxRecvMsgSize
|
||||
return nil
|
||||
}
|
||||
func (o MaxRecvMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o MaxRecvMsgSizeCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// MaxCallSendMsgSize returns a CallOption which sets the maximum message size
|
||||
// in bytes the client can send. If this is not set, gRPC uses the default
|
||||
|
@ -387,7 +387,7 @@ func (o MaxSendMsgSizeCallOption) before(c *callInfo) error {
|
|||
c.maxSendMessageSize = &o.MaxSendMsgSize
|
||||
return nil
|
||||
}
|
||||
func (o MaxSendMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o MaxSendMsgSizeCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// PerRPCCredentials returns a CallOption that sets credentials.PerRPCCredentials
|
||||
// for a call.
|
||||
|
@ -410,7 +410,7 @@ func (o PerRPCCredsCallOption) before(c *callInfo) error {
|
|||
c.creds = o.Creds
|
||||
return nil
|
||||
}
|
||||
func (o PerRPCCredsCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o PerRPCCredsCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// UseCompressor returns a CallOption which sets the compressor used when
|
||||
// sending the request. If WithCompressor is also set, UseCompressor has
|
||||
|
@ -438,7 +438,7 @@ func (o CompressorCallOption) before(c *callInfo) error {
|
|||
c.compressorType = o.CompressorType
|
||||
return nil
|
||||
}
|
||||
func (o CompressorCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o CompressorCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// CallContentSubtype returns a CallOption that will set the content-subtype
|
||||
// for a call. For example, if content-subtype is "json", the Content-Type over
|
||||
|
@ -475,7 +475,7 @@ func (o ContentSubtypeCallOption) before(c *callInfo) error {
|
|||
c.contentSubtype = o.ContentSubtype
|
||||
return nil
|
||||
}
|
||||
func (o ContentSubtypeCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o ContentSubtypeCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// ForceCodec returns a CallOption that will set codec to be used for all
|
||||
// request and response messages for a call. The result of calling Name() will
|
||||
|
@ -514,7 +514,7 @@ func (o ForceCodecCallOption) before(c *callInfo) error {
|
|||
c.codec = newCodecV1Bridge(o.Codec)
|
||||
return nil
|
||||
}
|
||||
func (o ForceCodecCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o ForceCodecCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// ForceCodecV2 returns a CallOption that will set codec to be used for all
|
||||
// request and response messages for a call. The result of calling Name() will
|
||||
|
@ -554,7 +554,7 @@ func (o ForceCodecV2CallOption) before(c *callInfo) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (o ForceCodecV2CallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o ForceCodecV2CallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// CallCustomCodec behaves like ForceCodec, but accepts a grpc.Codec instead of
|
||||
// an encoding.Codec.
|
||||
|
@ -579,7 +579,7 @@ func (o CustomCodecCallOption) before(c *callInfo) error {
|
|||
c.codec = newCodecV0Bridge(o.Codec)
|
||||
return nil
|
||||
}
|
||||
func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o CustomCodecCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory
|
||||
// used for buffering this RPC's requests for retry purposes.
|
||||
|
@ -607,7 +607,7 @@ func (o MaxRetryRPCBufferSizeCallOption) before(c *callInfo) error {
|
|||
c.maxRetryRPCBufferSize = o.MaxRetryRPCBufferSize
|
||||
return nil
|
||||
}
|
||||
func (o MaxRetryRPCBufferSizeCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||
func (o MaxRetryRPCBufferSizeCallOption) after(*callInfo, *csAttempt) {}
|
||||
|
||||
// The format of the payload: compressed or not?
|
||||
type payloadFormat uint8
|
||||
|
|
|
@ -22,15 +22,35 @@ package grpc
|
|||
// request, many responses) RPC. It is generic over the type of the response
|
||||
// message. It is used in generated code.
|
||||
type ServerStreamingClient[Res any] interface {
|
||||
// Recv receives the next response message from the server. The client may
|
||||
// repeatedly call Recv to read messages from the response stream. If
|
||||
// io.EOF is returned, the stream has terminated with an OK status. Any
|
||||
// other error is compatible with the status package and indicates the
|
||||
// RPC's status code and message.
|
||||
Recv() (*Res, error)
|
||||
|
||||
// ClientStream is embedded to provide Context, Header, and Trailer
|
||||
// functionality. No other methods in the ClientStream should be called
|
||||
// directly.
|
||||
ClientStream
|
||||
}
|
||||
|
||||
// ServerStreamingServer represents the server side of a server-streaming (one
|
||||
// request, many responses) RPC. It is generic over the type of the response
|
||||
// message. It is used in generated code.
|
||||
//
|
||||
// To terminate the response stream, return from the handler method and return
|
||||
// an error from the status package, or use nil to indicate an OK status code.
|
||||
type ServerStreamingServer[Res any] interface {
|
||||
// Send sends a response message to the client. The server handler may
|
||||
// call Send multiple times to send multiple messages to the client. An
|
||||
// error is returned if the stream was terminated unexpectedly, and the
|
||||
// handler method should return, as the stream is no longer usable.
|
||||
Send(*Res) error
|
||||
|
||||
// ServerStream is embedded to provide Context, SetHeader, SendHeader, and
|
||||
// SetTrailer functionality. No other methods in the ServerStream should
|
||||
// be called directly.
|
||||
ServerStream
|
||||
}
|
||||
|
||||
|
@ -39,8 +59,22 @@ type ServerStreamingServer[Res any] interface {
|
|||
// message stream and the type of the unary response message. It is used in
|
||||
// generated code.
|
||||
type ClientStreamingClient[Req any, Res any] interface {
|
||||
// Send sends a request message to the server. The client may call Send
|
||||
// multiple times to send multiple messages to the server. On error, Send
|
||||
// aborts the stream. If the error was generated by the client, the status
|
||||
// is returned directly. Otherwise, io.EOF is returned, and the status of
|
||||
// the stream may be discovered using CloseAndRecv().
|
||||
Send(*Req) error
|
||||
|
||||
// CloseAndRecv closes the request stream and waits for the server's
|
||||
// response. This method must be called once and only once after sending
|
||||
// all request messages. Any error returned is implemented by the status
|
||||
// package.
|
||||
CloseAndRecv() (*Res, error)
|
||||
|
||||
// ClientStream is embedded to provide Context, Header, and Trailer
|
||||
// functionality. No other methods in the ClientStream should be called
|
||||
// directly.
|
||||
ClientStream
|
||||
}
|
||||
|
||||
|
@ -48,9 +82,28 @@ type ClientStreamingClient[Req any, Res any] interface {
|
|||
// requests, one response) RPC. It is generic over both the type of the request
|
||||
// message stream and the type of the unary response message. It is used in
|
||||
// generated code.
|
||||
//
|
||||
// To terminate the RPC, call SendAndClose and return nil from the method
|
||||
// handler or do not call SendAndClose and return an error from the status
|
||||
// package.
|
||||
type ClientStreamingServer[Req any, Res any] interface {
|
||||
// Recv receives the next request message from the client. The server may
|
||||
// repeatedly call Recv to read messages from the request stream. If
|
||||
// io.EOF is returned, it indicates the client called CloseAndRecv on its
|
||||
// ClientStreamingClient. Any other error indicates the stream was
|
||||
// terminated unexpectedly, and the handler method should return, as the
|
||||
// stream is no longer usable.
|
||||
Recv() (*Req, error)
|
||||
|
||||
// SendAndClose sends a single response message to the client and closes
|
||||
// the stream. This method must be called once and only once after all
|
||||
// request messages have been processed. Recv should not be called after
|
||||
// calling SendAndClose.
|
||||
SendAndClose(*Res) error
|
||||
|
||||
// ServerStream is embedded to provide Context, SetHeader, SendHeader, and
|
||||
// SetTrailer functionality. No other methods in the ServerStream should
|
||||
// be called directly.
|
||||
ServerStream
|
||||
}
|
||||
|
||||
|
@ -59,8 +112,23 @@ type ClientStreamingServer[Req any, Res any] interface {
|
|||
// request message stream and the type of the response message stream. It is
|
||||
// used in generated code.
|
||||
type BidiStreamingClient[Req any, Res any] interface {
|
||||
// Send sends a request message to the server. The client may call Send
|
||||
// multiple times to send multiple messages to the server. On error, Send
|
||||
// aborts the stream. If the error was generated by the client, the status
|
||||
// is returned directly. Otherwise, io.EOF is returned, and the status of
|
||||
// the stream may be discovered using Recv().
|
||||
Send(*Req) error
|
||||
|
||||
// Recv receives the next response message from the server. The client may
|
||||
// repeatedly call Recv to read messages from the response stream. If
|
||||
// io.EOF is returned, the stream has terminated with an OK status. Any
|
||||
// other error is compatible with the status package and indicates the
|
||||
// RPC's status code and message.
|
||||
Recv() (*Res, error)
|
||||
|
||||
// ClientStream is embedded to provide Context, Header, Trailer, and
|
||||
// CloseSend functionality. No other methods in the ClientStream should be
|
||||
// called directly.
|
||||
ClientStream
|
||||
}
|
||||
|
||||
|
@ -68,9 +136,27 @@ type BidiStreamingClient[Req any, Res any] interface {
|
|||
// (many requests, many responses) RPC. It is generic over both the type of the
|
||||
// request message stream and the type of the response message stream. It is
|
||||
// used in generated code.
|
||||
//
|
||||
// To terminate the stream, return from the handler method and return
|
||||
// an error from the status package, or use nil to indicate an OK status code.
|
||||
type BidiStreamingServer[Req any, Res any] interface {
|
||||
// Recv receives the next request message from the client. The server may
|
||||
// repeatedly call Recv to read messages from the request stream. If
|
||||
// io.EOF is returned, it indicates the client called CloseSend on its
|
||||
// BidiStreamingClient. Any other error indicates the stream was
|
||||
// terminated unexpectedly, and the handler method should return, as the
|
||||
// stream is no longer usable.
|
||||
Recv() (*Req, error)
|
||||
|
||||
// Send sends a response message to the client. The server handler may
|
||||
// call Send multiple times to send multiple messages to the client. An
|
||||
// error is returned if the stream was terminated unexpectedly, and the
|
||||
// handler method should return, as the stream is no longer usable.
|
||||
Send(*Res) error
|
||||
|
||||
// ServerStream is embedded to provide Context, SetHeader, SendHeader, and
|
||||
// SetTrailer functionality. No other methods in the ServerStream should
|
||||
// be called directly.
|
||||
ServerStream
|
||||
}
|
||||
|
||||
|
|
|
@ -19,4 +19,4 @@
|
|||
package grpc
|
||||
|
||||
// Version is the current grpc version.
|
||||
const Version = "1.66.2"
|
||||
const Version = "1.67.0"
|
||||
|
|
|
@ -252,13 +252,13 @@ gomodules.xyz/jsonpatch/v2
|
|||
# google.golang.org/api v0.183.0
|
||||
## explicit; go 1.20
|
||||
google.golang.org/api/support/bundler
|
||||
# google.golang.org/genproto/googleapis/api v0.0.0-20240808171019-573a1156607a
|
||||
## explicit; go 1.20
|
||||
# google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
|
||||
## explicit; go 1.21
|
||||
google.golang.org/genproto/googleapis/api/httpbody
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a
|
||||
## explicit; go 1.20
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142
|
||||
## explicit; go 1.21
|
||||
google.golang.org/genproto/googleapis/rpc/status
|
||||
# google.golang.org/grpc v1.66.2
|
||||
# google.golang.org/grpc v1.67.0
|
||||
## explicit; go 1.21
|
||||
google.golang.org/grpc
|
||||
google.golang.org/grpc/attributes
|
||||
|
@ -704,7 +704,7 @@ k8s.io/utils/trace
|
|||
# knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d
|
||||
## explicit; go 1.21
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20240917091217-aaab500c26c4
|
||||
# knative.dev/pkg v0.0.0-20240923063442-aabe552ba5e6
|
||||
## explicit; go 1.22.0
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue