/
ping.service.go
74 lines (60 loc) · 1.33 KB
/
ping.service.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package svcs
import (
"context"
gorpc "github.com/libp2p/go-libp2p-gorpc"
"log"
)
type PingArgs struct {
Data []byte
}
type PingReply struct {
Data []byte
}
type PingService struct{}
func (t *PingService) Path() string {
//TODO implement me
panic("implement me")
}
func (t *PingService) GrpcServer(ctx context.Context, rpc *gorpc.Server) {
//TODO implement me
panic("implement me")
}
func (t *PingService) GrpcClient(ctx context.Context, rpc *gorpc.Client) {
//TODO implement me
panic("implement me")
}
func (t *PingService) SignedHash() []byte {
//TODO implement me
panic("implement me")
}
func (t *PingService) ACL(m ...map[string]string) {
//TODO implement me
panic("implement me")
}
func (t *PingService) StartServer() error {
//TODO implement me
panic("implement me")
}
func (t *PingService) StartClient() error {
//TODO implement me
panic("implement me")
}
func (t *PingService) Close() {
//TODO implement me
panic("implement me")
}
func (t *PingService) State() interface{} {
//TODO implement me
panic("implement me")
}
func (t *PingService) Ping(ctx context.Context, argType PingArgs, replyType *PingReply) error {
log.Println("Received a Ping call")
replyType.Data = argType.Data
return nil
}
func (t *PingService) Name() string {
return "ping"
}
func NewPingService() *PingService {
return &PingService{}
}