forked from dedis/cothority_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct.go
46 lines (38 loc) · 989 Bytes
/
struct.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
package template
/*
This holds the messages used to communicate with the service over the network.
*/
import (
"gopkg.in/dedis/onet.v1"
"gopkg.in/dedis/onet.v1/network"
)
// We need to register all messages so the network knows how to handle them.
func init() {
for _, msg := range []interface{}{
CountRequest{}, CountResponse{},
ClockRequest{}, ClockResponse{},
} {
network.RegisterMessage(msg)
}
}
const (
// ErrorParse indicates an error while parsing the protobuf-file.
ErrorParse = iota + 4000
)
// ClockRequest will run the tepmlate-protocol on the roster and return
// the time spent doing so.
type ClockRequest struct {
Roster *onet.Roster
}
// ClockResponse returns the time spent for the protocol-run.
type ClockResponse struct {
Time float64
Children int
}
// CountRequest will return how many times the protocol has been run.
type CountRequest struct {
}
// CountResponse returns the number of protocol-runs
type CountResponse struct {
Count int
}