/
empty_server.go
162 lines (128 loc) 路 5.3 KB
/
empty_server.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package net
import (
"context"
"google.golang.org/grpc"
"github.com/drand/drand/protobuf/drand"
)
// EmptyServer is an PublicServer + ProtocolServer that does nothing
type EmptyServer struct{}
// GetIdentity returns the identity of the server
func (s *EmptyServer) GetIdentity(ctx context.Context, in *drand.IdentityRequest) (*drand.IdentityResponse, error) {
return nil, nil
}
// PublicRandStream is an empty implementation
func (s *EmptyServer) PublicRandStream(*drand.PublicRandRequest, drand.Public_PublicRandStreamServer) error {
return nil
}
// PublicRand is an empty implementation
func (s *EmptyServer) PublicRand(context.Context, *drand.PublicRandRequest) (*drand.PublicRandResponse, error) {
return nil, nil
}
// PrivateRand is an empty implementation
func (s *EmptyServer) PrivateRand(context.Context, *drand.PrivateRandRequest) (*drand.PrivateRandResponse, error) {
return nil, nil
}
// ChainInfo is an empty implementation
func (s *EmptyServer) ChainInfo(context.Context, *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error) {
return nil, nil
}
// Home is an empty implementation
func (s *EmptyServer) Home(context.Context, *drand.HomeRequest) (*drand.HomeResponse, error) {
return nil, nil
}
// SignalDKGParticipant is an empty implementation
func (s *EmptyServer) SignalDKGParticipant(context.Context, *drand.SignalDKGPacket) (*drand.Empty, error) {
return nil, nil
}
// PushDKGInfo is an empty implementation
func (s *EmptyServer) PushDKGInfo(context.Context, *drand.DKGInfoPacket) (*drand.Empty, error) {
return nil, nil
}
// BroadcastDKG is an empty implementation
func (s *EmptyServer) BroadcastDKG(context.Context, *drand.DKGPacket) (*drand.Empty, error) {
return nil, nil
}
// SyncChain is an empty implementation
func (s *EmptyServer) SyncChain(*drand.SyncRequest, drand.Protocol_SyncChainServer) error {
return nil
}
// StartFollowChain is the control method to instruct a drand daemon to sync its chain
func (s *EmptyServer) StartFollowChain(*drand.StartSyncRequest, drand.Control_StartFollowChainServer) error {
return nil
}
// StartCheckChain is the control method to instruct a drand daemon to check its chain
func (s *EmptyServer) StartCheckChain(*drand.StartSyncRequest, drand.Control_StartCheckChainServer) error {
return nil
}
// Status method
func (s *EmptyServer) Status(context.Context, *drand.StatusRequest) (*drand.StatusResponse, error) {
return nil, nil
}
// PartialBeacon is an empty implementation
func (s *EmptyServer) PartialBeacon(context.Context, *drand.PartialBeaconPacket) (*drand.Empty, error) {
return nil, nil
}
// PingPong is an empty implementation
func (s *EmptyServer) PingPong(context.Context, *drand.Ping) (*drand.Pong, error) {
return nil, nil
}
// ListSchemes is an empty implementation
func (s *EmptyServer) ListSchemes(context.Context, *drand.ListSchemesRequest) (*drand.ListSchemesResponse, error) {
return nil, nil
}
// ListBeaconIDs is an empty implementation
func (s *EmptyServer) ListBeaconIDs(context.Context, *drand.ListBeaconIDsRequest) (*drand.ListBeaconIDsResponse, error) {
return nil, nil
}
// InitDKG is an empty implementation
func (s *EmptyServer) InitDKG(context.Context, *drand.InitDKGPacket) (*drand.GroupPacket, error) {
return nil, nil
}
// InitReshare is an empty implementation
func (s *EmptyServer) InitReshare(context.Context, *drand.InitResharePacket) (*drand.GroupPacket, error) {
return nil, nil
}
// Share is an empty implementation
func (s *EmptyServer) Share(context.Context, *drand.ShareRequest) (*drand.ShareResponse, error) {
return nil, nil
}
// PublicKey is an empty implementation
func (s *EmptyServer) PublicKey(context.Context, *drand.PublicKeyRequest) (*drand.PublicKeyResponse, error) {
return nil, nil
}
// PrivateKey is an empty implementation
func (s *EmptyServer) PrivateKey(context.Context, *drand.PrivateKeyRequest) (*drand.PrivateKeyResponse, error) {
return nil, nil
}
// CollectiveKey is an empty implementation
func (s *EmptyServer) CollectiveKey(context.Context, *drand.CokeyRequest) (*drand.CokeyResponse, error) {
return nil, nil
}
// GroupFile is an empty implementation
func (s *EmptyServer) GroupFile(context.Context, *drand.GroupRequest) (*drand.GroupPacket, error) {
return nil, nil
}
// Shutdown is an empty implementation
func (s *EmptyServer) Shutdown(context.Context, *drand.ShutdownRequest) (*drand.ShutdownResponse, error) {
return nil, nil
}
// ReloadBeacon is an empty implementation
func (s *EmptyServer) LoadBeacon(context.Context, *drand.LoadBeaconRequest) (*drand.LoadBeaconResponse, error) {
return nil, nil
}
// RemoteStatus is an empty implementation
func (s *EmptyServer) RemoteStatus(context.Context, *drand.RemoteStatusRequest) (*drand.RemoteStatusResponse, error) {
return nil, nil
}
// BackupDatabase is an empty implementation
func (s *EmptyServer) BackupDatabase(context.Context, *drand.BackupDBRequest) (*drand.BackupDBResponse, error) {
return nil, nil
}
// Shutdown is an empty implementation
func (s *EmptyServer) NodeVersionValidator(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (response interface{}, err error) {
return handler(ctx, req)
}
// Shutdown is an empty implementation
func (s *EmptyServer) NodeVersionStreamValidator(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
return handler(srv, ss)
}