diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d14142e..71c4f4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,7 +114,7 @@ New files that you contribute should use the standard copyright header: // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/CONTRIBUTING.zh_CN.md b/CONTRIBUTING.zh_CN.md index 53f6ee6..d16538f 100644 --- a/CONTRIBUTING.zh_CN.md +++ b/CONTRIBUTING.zh_CN.md @@ -104,7 +104,7 @@ go-codec 代码仓库中的文件不列出作者姓名,以避免混乱并避 // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/LICENSE b/LICENSE index 0435a0a..46f3cec 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. +Copyright (C) 2023 Tencent. All rights reserved. trpc-codec is licensed under the Apache License Version 2.0 except for the third-party components listed below. diff --git a/README.md b/README.md index 3e6c7e0..bb70218 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,7 @@ This repository provides implementations and examples of other protocols, curren * grpc: Supports grpc protocol * rawbinary: Supports the protocol where both request and response are `[]byte` under the udp transport layer protocol * rawstring: Supports the protocol where both request and response are string types under the tcp transport layer protocol, with strings separated by `"\n"` + +## Copyright + +The copyright notice pertaining to the Tencent code in this repo was previously in the name of “THL A29 Limited.” That entity has now been de-registered. You should treat all previously distributed copies of the code as if the copyright notice was in the name of “Tencent.” diff --git a/grpc/client_transport.go b/grpc/client_transport.go index 4dc626f..b32cec0 100644 --- a/grpc/client_transport.go +++ b/grpc/client_transport.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/client_transport_test.go b/grpc/client_transport_test.go index fe42902..ef50af9 100644 --- a/grpc/client_transport_test.go +++ b/grpc/client_transport_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/codec.go b/grpc/codec.go index 55c4816..e5c893c 100644 --- a/grpc/codec.go +++ b/grpc/codec.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/codec_test.go b/grpc/codec_test.go index 62554f6..99b404f 100644 --- a/grpc/codec_test.go +++ b/grpc/codec_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/examples/clients/grpc/main.go b/grpc/examples/clients/grpc/main.go index 279ce32..1fd23d9 100644 --- a/grpc/examples/clients/grpc/main.go +++ b/grpc/examples/clients/grpc/main.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -15,59 +15,59 @@ package main import ( - "context" - "fmt" - "log" + "context" + "fmt" + "log" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "go.opentelemetry.io/otel" - stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" - "go.opentelemetry.io/otel/propagation" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" - "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" - pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/grpc" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel" + stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" + "go.opentelemetry.io/otel/propagation" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" + pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/grpc" ) func main() { - // create a client connection - conn, err := grpc.Dial("127.0.0.1:5051", grpc.WithInsecure()) - if err != nil { - panic(err) - } - defer conn.Close() + // create a client connection + conn, err := grpc.Dial("127.0.0.1:5051", grpc.WithInsecure()) + if err != nil { + panic(err) + } + defer conn.Close() - // creates an Exporter - exporter, err := stdout.New(stdout.WithPrettyPrint()) - if err != nil { - log.Fatal(err) - } - // generate TracerProvider - tp := sdktrace.NewTracerProvider( - sdktrace.WithSampler(sdktrace.AlwaysSample()), - sdktrace.WithBatcher(exporter), - ) - // register TracerProvider - otel.SetTracerProvider(tp) - otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) - tracer := otel.GetTracerProvider().Tracer("grpc-client") - ctx, span := tracer.Start(context.Background(), "hello") - defer span.End() + // creates an Exporter + exporter, err := stdout.New(stdout.WithPrettyPrint()) + if err != nil { + log.Fatal(err) + } + // generate TracerProvider + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.AlwaysSample()), + sdktrace.WithBatcher(exporter), + ) + // register TracerProvider + otel.SetTracerProvider(tp) + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) + tracer := otel.GetTracerProvider().Tracer("grpc-client") + ctx, span := tracer.Start(context.Background(), "hello") + defer span.End() - // injects correlation context and span context into the gRPC - md := metadata.MD{} - otelgrpc.Inject(ctx, &md) + // injects correlation context and span context into the gRPC + md := metadata.MD{} + otelgrpc.Inject(ctx, &md) - // creates a new context with outgoing md attached - ctx = metadata.NewOutgoingContext(ctx, md) + // creates a new context with outgoing md attached + ctx = metadata.NewOutgoingContext(ctx, md) - c := pb.NewGreeterClient(conn) - // send rpc request - if rsp, err := c.Hello(ctx, &common.HelloReq{Msg: "abc"}); err != nil { - panic(err) - } else { - fmt.Print(rsp) - } + c := pb.NewGreeterClient(conn) + // send rpc request + if rsp, err := c.Hello(ctx, &common.HelloReq{Msg: "abc"}); err != nil { + panic(err) + } else { + fmt.Print(rsp) + } } diff --git a/grpc/examples/clients/tgrpc_stream/main.go b/grpc/examples/clients/tgrpc_stream/main.go index 4e3f8be..fb9d800 100644 --- a/grpc/examples/clients/tgrpc_stream/main.go +++ b/grpc/examples/clients/tgrpc_stream/main.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -15,159 +15,160 @@ package main import ( - "context" - "fmt" - "io" - "time" - - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "go.opentelemetry.io/otel" - stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" - "go.opentelemetry.io/otel/propagation" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - "google.golang.org/grpc/metadata" - common "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" - pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/streams" - "trpc.group/trpc-go/trpc-go/client" - "trpc.group/trpc-go/trpc-go/log" + "context" + "fmt" + "io" + "time" + + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel" + stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" + "go.opentelemetry.io/otel/propagation" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + "google.golang.org/grpc/metadata" + common "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" + pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/streams" + "trpc.group/trpc-go/trpc-go" + "trpc.group/trpc-go/trpc-go/client" + "trpc.group/trpc-go/trpc-go/log" ) func init() { - // register trace provider - exporter, err := stdout.New(stdout.WithPrettyPrint()) - if err != nil { - log.Fatal(err) - } - - // generate TracerProvider - tp := sdktrace.NewTracerProvider( - sdktrace.WithSampler(sdktrace.AlwaysSample()), - sdktrace.WithBatcher(exporter), - ) - // register TracerProvider - otel.SetTracerProvider(tp) - otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) + // register trace provider + exporter, err := stdout.New(stdout.WithPrettyPrint()) + if err != nil { + log.Fatal(err) + } + + // generate TracerProvider + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.AlwaysSample()), + sdktrace.WithBatcher(exporter), + ) + // register TracerProvider + otel.SetTracerProvider(tp) + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) } func main() { - opts := []client.Option{ - client.WithTarget("ip://127.0.0.1:5051"), - client.WithTimeout(1 * time.Second), - } - clientProxy := pb.NewGreeterClientProxy(opts...) - // test Hello - Hello(clientProxy) - - // test GetStream - GetStream(clientProxy) - - // test PutStream - PutStream(clientProxy) - - // test AllStream - AllStream(clientProxy) + opts := []client.Option{ + client.WithTarget("ip://127.0.0.1:5051"), + client.WithTimeout(1 * time.Second), + } + clientProxy := pb.NewGreeterClientProxy(opts...) + // test Hello + Hello(clientProxy) + + // test GetStream + GetStream(clientProxy) + + // test PutStream + PutStream(clientProxy) + + // test AllStream + AllStream(clientProxy) } // Hello send msg func Hello(c pb.GreeterClientProxy) { - req := &common.HelloReq{ - Msg: "trpc_client_Hello", - } - tracer := otel.GetTracerProvider().Tracer("grpc-client") - ctx, span := tracer.Start(trpc.BackgroundContext(), "hello") - defer span.End() - - // injects correlation context and span context into the gRPC - md := metadata.MD{} - otelgrpc.Inject(ctx, &md) - - // creates a new context with outgoing md attached - ctx = metadata.NewOutgoingContext(ctx, md) - rsp, err := c.Hello(ctx, req) - if err != nil { - log.Error(err) - } - log.Info(rsp) + req := &common.HelloReq{ + Msg: "trpc_client_Hello", + } + tracer := otel.GetTracerProvider().Tracer("grpc-client") + ctx, span := tracer.Start(trpc.BackgroundContext(), "hello") + defer span.End() + + // injects correlation context and span context into the gRPC + md := metadata.MD{} + otelgrpc.Inject(ctx, &md) + + // creates a new context with outgoing md attached + ctx = metadata.NewOutgoingContext(ctx, md) + rsp, err := c.Hello(ctx, req) + if err != nil { + log.Error(err) + } + log.Info(rsp) } // GetStream get stream msg func GetStream(c pb.GreeterClientProxy) { - req := &common.HelloReq{ - Msg: "trpc_client_Hello", - } - // GetStream - stream, err := c.GetStream(context.Background(), req) - if err != nil { - log.Error(err) - return - } - for { - rsp, err := stream.Recv() - if err != nil { - if err == io.EOF { - break - } - log.Error(err) - return - } - log.Info(rsp) - } + req := &common.HelloReq{ + Msg: "trpc_client_Hello", + } + // GetStream + stream, err := c.GetStream(context.Background(), req) + if err != nil { + log.Error(err) + return + } + for { + rsp, err := stream.Recv() + if err != nil { + if err == io.EOF { + break + } + log.Error(err) + return + } + log.Info(rsp) + } } // PutStream put stream msg func PutStream(c pb.GreeterClientProxy) { - stream, err := c.PutStream(context.Background()) - if err != nil { - log.Error(err) - return - } - // send stream 10 times - for i := 1; i <= 10; i++ { - if err := stream.Send(&common.HelloReq{Msg: fmt.Sprintf("req: %d", i)}); err != nil { - log.Error(err) - } - time.Sleep(1 * time.Second) - } - rsp, err := stream.CloseAndRecv() - if err != nil { - log.Error(err) - } - log.Info(rsp) + stream, err := c.PutStream(context.Background()) + if err != nil { + log.Error(err) + return + } + // send stream 10 times + for i := 1; i <= 10; i++ { + if err := stream.Send(&common.HelloReq{Msg: fmt.Sprintf("req: %d", i)}); err != nil { + log.Error(err) + } + time.Sleep(1 * time.Second) + } + rsp, err := stream.CloseAndRecv() + if err != nil { + log.Error(err) + } + log.Info(rsp) } // AllStream all func AllStream(c pb.GreeterClientProxy) { - stream, err := c.AllStream(context.Background()) - if err != nil { - log.Error(err) - return - } - go func() { - for { - data, err := stream.Recv() - if err != nil { - if err == io.EOF { - log.Info("EOF") - return - } - log.Error(err) - return - } - log.Info(data) - } - }() - for i := 1; i <= 10; i++ { - req := &common.HelloReq{ - Msg: fmt.Sprintf("grpc_client_all_stream_%d", i), - } - err := stream.Send(req) - if err != nil { - log.Error(err) - return - } - time.Sleep(1 * time.Second) - } - stream.CloseSend() + stream, err := c.AllStream(context.Background()) + if err != nil { + log.Error(err) + return + } + go func() { + for { + data, err := stream.Recv() + if err != nil { + if err == io.EOF { + log.Info("EOF") + return + } + log.Error(err) + return + } + log.Info(data) + } + }() + for i := 1; i <= 10; i++ { + req := &common.HelloReq{ + Msg: fmt.Sprintf("grpc_client_all_stream_%d", i), + } + err := stream.Send(req) + if err != nil { + log.Error(err) + return + } + time.Sleep(1 * time.Second) + } + stream.CloseSend() } diff --git a/grpc/examples/servers/impl/trpc/greeter.go b/grpc/examples/servers/impl/trpc/greeter.go index cbe8782..6304ae0 100644 --- a/grpc/examples/servers/impl/trpc/greeter.go +++ b/grpc/examples/servers/impl/trpc/greeter.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/examples/servers/tgrpc_stream/main.go b/grpc/examples/servers/tgrpc_stream/main.go index c706fd8..e62a2b3 100644 --- a/grpc/examples/servers/tgrpc_stream/main.go +++ b/grpc/examples/servers/tgrpc_stream/main.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -15,21 +15,22 @@ package main import ( - "context" - "fmt" - "io" - "time" + "context" + "fmt" + "io" + "time" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - "google.golang.org/grpc/metadata" - "trpc.group/trpc-go/trpc-codec/grpc" - common "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" - pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/streams" - "trpc.group/trpc-go/trpc-go/log" - "trpc.group/trpc-go/trpc-go/server" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + "google.golang.org/grpc/metadata" + "trpc.group/trpc-go/trpc-codec/grpc" + common "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" + pb "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/streams" + "trpc.group/trpc-go/trpc-go" + "trpc.group/trpc-go/trpc-go/log" + "trpc.group/trpc-go/trpc-go/server" ) // ServiceImpl impl @@ -37,87 +38,87 @@ type ServiceImpl struct { } func main() { - // generate TracerProvider - tp := sdktrace.NewTracerProvider( - sdktrace.WithSampler(sdktrace.AlwaysSample()), - ) + // generate TracerProvider + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.AlwaysSample()), + ) - // register TracerProvider - otel.SetTracerProvider(tp) - otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) - trpc.ServerConfigPath = "cfg.yaml" - s := trpc.NewServer(server.WithStreamTransport(grpc.DefaultServerStreamTransport)) + // register TracerProvider + otel.SetTracerProvider(tp) + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) + trpc.ServerConfigPath = "cfg.yaml" + s := trpc.NewServer(server.WithStreamTransport(grpc.DefaultServerStreamTransport)) - // register service - pb.RegisterGreeterService(s, &ServiceImpl{}) + // register service + pb.RegisterGreeterService(s, &ServiceImpl{}) - // starting all services - if err := s.Serve(); err != nil { - panic(err) - } + // starting all services + if err := s.Serve(); err != nil { + panic(err) + } } // Hello test func (s *ServiceImpl) Hello(ctx context.Context, req *common.HelloReq) (rsp *common.HelloRsp, err error) { - // get the incoming metadata in ctx - md, _ := metadata.FromIncomingContext(ctx) - _, sc := otelgrpc.Extract(ctx, &md) - log.WithContextFields(ctx, "id", sc.TraceID().String()) - log.Infof("Hello, req: %+v", req) - rsp = &common.HelloRsp{Msg: "OK"} - return rsp, nil + // get the incoming metadata in ctx + md, _ := metadata.FromIncomingContext(ctx) + _, sc := otelgrpc.Extract(ctx, &md) + log.WithContextFields(ctx, "id", sc.TraceID().String()) + log.Infof("Hello, req: %+v", req) + rsp = &common.HelloRsp{Msg: "OK"} + return rsp, nil } // GetStream GetStreamMsg func (s *ServiceImpl) GetStream(req *common.HelloReq, stream pb.Greeter_GetStreamServer) error { - log.Infof("GetStream, req: %+v", req) - for i := 1; i <= 10; i++ { - rsp := &common.HelloRsp{Msg: fmt.Sprintf("GetStream_Response_%d", i)} - // send response - err := stream.Send(rsp) - if err != nil { - log.Error(err) - return err - } - time.Sleep(1 * time.Second) - } - return nil + log.Infof("GetStream, req: %+v", req) + for i := 1; i <= 10; i++ { + rsp := &common.HelloRsp{Msg: fmt.Sprintf("GetStream_Response_%d", i)} + // send response + err := stream.Send(rsp) + if err != nil { + log.Error(err) + return err + } + time.Sleep(1 * time.Second) + } + return nil } // PutStream test func (s *ServiceImpl) PutStream(stream pb.Greeter_PutStreamServer) error { - for { - req, err := stream.Recv() - if err != nil { - if err == io.EOF { - // close stream - return stream.SendAndClose(&common.HelloRsp{Msg: "END"}) - } - log.Error(err) - return err - } - log.Infof("PutStream, req:%+v", req) - } + for { + req, err := stream.Recv() + if err != nil { + if err == io.EOF { + // close stream + return stream.SendAndClose(&common.HelloRsp{Msg: "END"}) + } + log.Error(err) + return err + } + log.Infof("PutStream, req:%+v", req) + } } // AllStream test func (s *ServiceImpl) AllStream(stream pb.Greeter_AllStreamServer) error { - for { - req, err := stream.Recv() - if err != nil { - if err == io.EOF { - break - } - log.Error(err) - return err - } - log.Infof("AllStream, req:%+v", req) - // send stream - err = stream.Send(&common.HelloRsp{Msg: "got" + req.Msg}) - if err != nil { - log.Error(err) - return err - } - } - return nil + for { + req, err := stream.Recv() + if err != nil { + if err == io.EOF { + break + } + log.Error(err) + return err + } + log.Infof("AllStream, req:%+v", req) + // send stream + err = stream.Send(&common.HelloRsp{Msg: "got" + req.Msg}) + if err != nil { + log.Error(err) + return err + } + } + return nil } diff --git a/grpc/header.go b/grpc/header.go index 6ad9b41..bc5f333 100644 --- a/grpc/header.go +++ b/grpc/header.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/header_test.go b/grpc/header_test.go index d026434..0126e36 100644 --- a/grpc/header_test.go +++ b/grpc/header_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/options.go b/grpc/options.go index 915772e..92c9bb1 100644 --- a/grpc/options.go +++ b/grpc/options.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/options_test.go b/grpc/options_test.go index 1459996..e89c6ee 100644 --- a/grpc/options_test.go +++ b/grpc/options_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/pool.go b/grpc/pool.go index 7b8925d..9a1301a 100644 --- a/grpc/pool.go +++ b/grpc/pool.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/register.go b/grpc/register.go index 25b6b1f..11e068e 100644 --- a/grpc/register.go +++ b/grpc/register.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/register_test.go b/grpc/register_test.go index 108afcd..2dc03f4 100644 --- a/grpc/register_test.go +++ b/grpc/register_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/server.go b/grpc/server.go index 2132330..a525bb8 100644 --- a/grpc/server.go +++ b/grpc/server.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/stream_client.go b/grpc/stream_client.go index 94a3092..89a21a9 100644 --- a/grpc/stream_client.go +++ b/grpc/stream_client.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/stream_client_test.go b/grpc/stream_client_test.go index 4d349cc..18ae5c4 100644 --- a/grpc/stream_client_test.go +++ b/grpc/stream_client_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/stream_server.go b/grpc/stream_server.go index 194f590..3dda895 100644 --- a/grpc/stream_server.go +++ b/grpc/stream_server.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/stream_server_test.go b/grpc/stream_server_test.go index 8f70e95..6dc5c3e 100644 --- a/grpc/stream_server_test.go +++ b/grpc/stream_server_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/common.proto b/grpc/testdata/protocols/common.proto index e394813..17abdf6 100644 --- a/grpc/testdata/protocols/common.proto +++ b/grpc/testdata/protocols/common.proto @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/greeter.proto b/grpc/testdata/protocols/greeter.proto index 49e3b12..f1ecbb9 100644 --- a/grpc/testdata/protocols/greeter.proto +++ b/grpc/testdata/protocols/greeter.proto @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/grpc/greeter_grpc.pb.go b/grpc/testdata/protocols/grpc/greeter_grpc.pb.go index d394c6e..70cef78 100644 --- a/grpc/testdata/protocols/grpc/greeter_grpc.pb.go +++ b/grpc/testdata/protocols/grpc/greeter_grpc.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -21,6 +21,7 @@ package greeter import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/grpc/testdata/protocols/gstreams/streams.pb.go b/grpc/testdata/protocols/gstreams/streams.pb.go index 3473e21..6b685ee 100644 --- a/grpc/testdata/protocols/gstreams/streams.pb.go +++ b/grpc/testdata/protocols/gstreams/streams.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -20,9 +20,10 @@ package streams import ( + reflect "reflect" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" common "trpc.group/trpc-go/trpc-codec/grpc/testdata/protocols/common" ) diff --git a/grpc/testdata/protocols/gstreams/streams_grpc.pb.go b/grpc/testdata/protocols/gstreams/streams_grpc.pb.go index ccaae2f..0b3c021 100644 --- a/grpc/testdata/protocols/gstreams/streams_grpc.pb.go +++ b/grpc/testdata/protocols/gstreams/streams_grpc.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, @@ -21,6 +21,7 @@ package streams import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/grpc/testdata/protocols/streams.proto b/grpc/testdata/protocols/streams.proto index 1e5563d..9636d2d 100644 --- a/grpc/testdata/protocols/streams.proto +++ b/grpc/testdata/protocols/streams.proto @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/tgrpc/greeter.pb.go b/grpc/testdata/protocols/tgrpc/greeter.pb.go index 169530c..1990954 100644 --- a/grpc/testdata/protocols/tgrpc/greeter.pb.go +++ b/grpc/testdata/protocols/tgrpc/greeter.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/tgrpc/greeter.trpc.go b/grpc/testdata/protocols/tgrpc/greeter.trpc.go index a06b581..8f85fd8 100644 --- a/grpc/testdata/protocols/tgrpc/greeter.trpc.go +++ b/grpc/testdata/protocols/tgrpc/greeter.trpc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/tgrpc/greeter_mock.go b/grpc/testdata/protocols/tgrpc/greeter_mock.go index b733363..373ac95 100644 --- a/grpc/testdata/protocols/tgrpc/greeter_mock.go +++ b/grpc/testdata/protocols/tgrpc/greeter_mock.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/trpc/greeter.pb.go b/grpc/testdata/protocols/trpc/greeter.pb.go index 169530c..1990954 100644 --- a/grpc/testdata/protocols/trpc/greeter.pb.go +++ b/grpc/testdata/protocols/trpc/greeter.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/trpc/greeter.trpc.go b/grpc/testdata/protocols/trpc/greeter.trpc.go index 35f6ebc..b92d91d 100644 --- a/grpc/testdata/protocols/trpc/greeter.trpc.go +++ b/grpc/testdata/protocols/trpc/greeter.trpc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/trpc/greeter_mock.go b/grpc/testdata/protocols/trpc/greeter_mock.go index b733363..373ac95 100644 --- a/grpc/testdata/protocols/trpc/greeter_mock.go +++ b/grpc/testdata/protocols/trpc/greeter_mock.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/tstreams/streams.pb.go b/grpc/testdata/protocols/tstreams/streams.pb.go index cc64638..6b685ee 100644 --- a/grpc/testdata/protocols/tstreams/streams.pb.go +++ b/grpc/testdata/protocols/tstreams/streams.pb.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/testdata/protocols/tstreams/streams.trpc.go b/grpc/testdata/protocols/tstreams/streams.trpc.go index 416f9cd..8a99a85 100644 --- a/grpc/testdata/protocols/tstreams/streams.trpc.go +++ b/grpc/testdata/protocols/tstreams/streams.trpc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/tgrpc.go b/grpc/tgrpc.go index c9417c4..caf1712 100644 --- a/grpc/tgrpc.go +++ b/grpc/tgrpc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/grpc/tgrpc_test.go b/grpc/tgrpc_test.go index 503623d..0993086 100644 --- a/grpc/tgrpc_test.go +++ b/grpc/tgrpc_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/client.go b/rawbinary/client.go index d6d26e3..da89dac 100644 --- a/rawbinary/client.go +++ b/rawbinary/client.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/client_test.go b/rawbinary/client_test.go index 8ea0fd8..dab7a76 100644 --- a/rawbinary/client_test.go +++ b/rawbinary/client_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/codec.go b/rawbinary/codec.go index 0a738a2..a438a4b 100644 --- a/rawbinary/codec.go +++ b/rawbinary/codec.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/codec_test.go b/rawbinary/codec_test.go index fe0f21b..c4d9666 100644 --- a/rawbinary/codec_test.go +++ b/rawbinary/codec_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/examples/helloworld/main.go b/rawbinary/examples/helloworld/main.go index e9da4c6..f4fb461 100644 --- a/rawbinary/examples/helloworld/main.go +++ b/rawbinary/examples/helloworld/main.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/service_desc.go b/rawbinary/service_desc.go index 0204246..f7c9b13 100644 --- a/rawbinary/service_desc.go +++ b/rawbinary/service_desc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawbinary/service_desc_test.go b/rawbinary/service_desc_test.go index 3b884da..4f99018 100644 --- a/rawbinary/service_desc_test.go +++ b/rawbinary/service_desc_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/client.go b/rawstring/client.go index 7afe18b..700dc93 100644 --- a/rawstring/client.go +++ b/rawstring/client.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/codec.go b/rawstring/codec.go index 336a931..ca30d4b 100644 --- a/rawstring/codec.go +++ b/rawstring/codec.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/codec_test.go b/rawstring/codec_test.go index 26e3b25..20b1d8e 100644 --- a/rawstring/codec_test.go +++ b/rawstring/codec_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/frame.go b/rawstring/frame.go index fa0891e..47d908f 100644 --- a/rawstring/frame.go +++ b/rawstring/frame.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/frame_test.go b/rawstring/frame_test.go index ad09861..b2c442d 100644 --- a/rawstring/frame_test.go +++ b/rawstring/frame_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/server_example/server_hello/main.go b/rawstring/server_example/server_hello/main.go index f4ca717..b0f54c7 100644 --- a/rawstring/server_example/server_hello/main.go +++ b/rawstring/server_example/server_hello/main.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/service_desc.go b/rawstring/service_desc.go index 51fed2c..2c2cafd 100644 --- a/rawstring/service_desc.go +++ b/rawstring/service_desc.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent, diff --git a/rawstring/service_desc_test.go b/rawstring/service_desc_test.go index accfb7f..971df64 100644 --- a/rawstring/service_desc_test.go +++ b/rawstring/service_desc_test.go @@ -2,7 +2,7 @@ // // Tencent is pleased to support the open source community by making tRPC available. // -// Copyright (C) 2023 THL A29 Limited, a Tencent company. +// Copyright (C) 2023 Tencent. // All rights reserved. // // If you have downloaded a copy of the tRPC source code from Tencent,