-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.go
More file actions
executable file
·40 lines (33 loc) · 795 Bytes
/
sample.go
File metadata and controls
executable file
·40 lines (33 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"fmt"
"git.apache.org/thrift.git/lib/go/thrift"
"gitlab.int.jumei.com/JMArch/go-rpc/example/trusteeship"
"gitlab.int.jumei.com/JMArch/go-rpc/jmthrift-proto"
)
func main() {
transport, err := thrift.NewTSocket("127.0.0.1:9898")
if err != nil {
panic(err)
}
defer transport.Close()
err = transport.Open()
if err != nil {
panic(err)
}
trans := jmthriftProto.NewFramedTransport(transport)
prot := jmthriftProto.NewBinaryProtocol(jmthriftProto.NewOwlContext(), trans)
client := trusteeship.NewTrusteeshipDataClientProtocol(trans, prot, prot)
r, err := client.IsExist(123456)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(r)
r, err = client.GetDecryptPhoneNumber(123456)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(r)
}