File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ func (u *UserAgent) factoryFor(makeEndpoint func(src.Service) endpoint.Endpoint)
79
79
func (u * UserAgent ) NewGRPCClient (conn * grpc.ClientConn ) src.Service {
80
80
options := []grpctransport.ClientOption {
81
81
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 ()
83
83
md .Set (src .ContextReqUUid , UUID )
84
84
ctx = metadata .NewOutgoingContext (context .Background (), * md )
85
85
return ctx
Original file line number Diff line number Diff line change @@ -54,12 +54,12 @@ func TestGrpc(t *testing.T) {
54
54
}
55
55
defer conn .Close ()
56
56
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 ()
58
58
md := metadata .Pairs (src .ContextReqUUid , UUID )
59
59
ctx := metadata .NewOutgoingContext (context .Background (), md )
60
60
res , err := userClient .RpcUserLogin (ctx , & pb.Login {
61
- Account : "hw " ,
62
- Password : "123 " ,
61
+ Account : "hwholiday " ,
62
+ Password : "123456 " ,
63
63
})
64
64
if err != nil {
65
65
t .Error (err )
Original file line number Diff line number Diff line change
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
+ )
You can’t perform that action at this time.
0 commit comments