Skip to content

Commit f263264

Browse files
committed
save
1 parent bb86970 commit f263264

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

go-kit/v6/go.mod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module learning_tools/go-kit/v6
2+
3+
go 1.14
4+
5+
require (
6+
github.com/dgrijalva/jwt-go v3.2.0+incompatible
7+
github.com/go-kit/kit v0.10.0
8+
github.com/golang/protobuf v1.4.2
9+
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
10+
github.com/satori/go.uuid v1.2.0
11+
go.uber.org/zap v1.16.0
12+
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
13+
google.golang.org/grpc v1.33.0
14+
google.golang.org/grpc/examples v0.0.0-20201010204749-3c400e7fcc87 // indirect
15+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
16+
learning_tools/all_packaged_library v0.0.0-00010101000000-000000000000
17+
)
18+
replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
19+
replace learning_tools/all_packaged_library => ../../all_packaged_library

go-kit/v6/user_agent/client/user_agent_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (u *UserAgent) factoryFor(makeEndpoint func(src.Service) endpoint.Endpoint)
7979
func (u *UserAgent) NewGRPCClient(conn *grpc.ClientConn) src.Service {
8080
options := []grpctransport.ClientOption{
8181
grpctransport.ClientBefore(func(ctx context.Context, md *metadata.MD) context.Context {
82-
UUID := uuid.NewV5(uuid.Must(uuid.NewV4()), "req_uuid").String()
82+
UUID := uuid.NewV5(uuid.Must(uuid.NewV4(), nil), "req_uuid").String()
8383
md.Set(src.ContextReqUUid, UUID)
8484
ctx = metadata.NewOutgoingContext(context.Background(), *md)
8585
return ctx

go-kit/v6/user_agent/client/user_agent_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ func TestGrpc(t *testing.T) {
5454
}
5555
defer conn.Close()
5656
userClient := pb.NewUserClient(conn)
57-
UUID := uuid.NewV5(uuid.Must(uuid.NewV4()), "req_uuid").String()
57+
UUID := uuid.NewV5(uuid.Must(uuid.NewV4(), nil), "req_uuid").String()
5858
md := metadata.Pairs(src.ContextReqUUid, UUID)
5959
ctx := metadata.NewOutgoingContext(context.Background(), md)
6060
res, err := userClient.RpcUserLogin(ctx, &pb.Login{
61-
Account: "hw",
62-
Password: "123",
61+
Account: "hwholiday",
62+
Password: "123456",
6363
})
6464
if err != nil {
6565
t.Error(err)

grpc/simple_rpc/go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module learning_tools/grpc/simple_rpc
2+
3+
go 1.14
4+
5+
require (
6+
github.com/golang/protobuf v1.4.2
7+
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb
8+
google.golang.org/grpc v1.33.0
9+
)

0 commit comments

Comments
 (0)