forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.go
114 lines (94 loc) · 3.21 KB
/
common.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
// Auto-generated by avdl-compiler v1.3.12 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/gregor1/common.avdl
package gregor1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type TimeOrOffset struct {
Time_ Time `codec:"time" json:"time"`
Offset_ DurationMsec `codec:"offset" json:"offset"`
}
type Metadata struct {
Uid_ UID `codec:"uid" json:"uid"`
MsgID_ MsgID `codec:"msgID" json:"msgID"`
Ctime_ Time `codec:"ctime" json:"ctime"`
DeviceID_ DeviceID `codec:"deviceID" json:"deviceID"`
InBandMsgType_ int `codec:"inBandMsgType" json:"inBandMsgType"`
}
type InBandMessage struct {
StateUpdate_ *StateUpdateMessage `codec:"stateUpdate,omitempty" json:"stateUpdate,omitempty"`
StateSync_ *StateSyncMessage `codec:"stateSync,omitempty" json:"stateSync,omitempty"`
}
type State struct {
Items_ []ItemAndMetadata `codec:"items" json:"items"`
}
type StateUpdateMessage struct {
Md_ Metadata `codec:"md" json:"md"`
Creation_ *Item `codec:"creation,omitempty" json:"creation,omitempty"`
Dismissal_ *Dismissal `codec:"dismissal,omitempty" json:"dismissal,omitempty"`
}
type StateSyncMessage struct {
Md_ Metadata `codec:"md" json:"md"`
}
type MsgRange struct {
EndTime_ TimeOrOffset `codec:"endTime" json:"endTime"`
Category_ Category `codec:"category" json:"category"`
}
type Dismissal struct {
MsgIDs_ []MsgID `codec:"msgIDs" json:"msgIDs"`
Ranges_ []MsgRange `codec:"ranges" json:"ranges"`
}
type Item struct {
Category_ Category `codec:"category" json:"category"`
Dtime_ TimeOrOffset `codec:"dtime" json:"dtime"`
RemindTimes_ []TimeOrOffset `codec:"remindTimes" json:"remindTimes"`
Body_ Body `codec:"body" json:"body"`
}
type ItemAndMetadata struct {
Md_ *Metadata `codec:"md,omitempty" json:"md,omitempty"`
Item_ *Item `codec:"item,omitempty" json:"item,omitempty"`
}
type Reminder struct {
Item_ ItemAndMetadata `codec:"item" json:"item"`
Seqno_ int `codec:"seqno" json:"seqno"`
RemindTime_ Time `codec:"remindTime" json:"remindTime"`
}
type ReminderID struct {
Uid_ UID `codec:"uid" json:"uid"`
MsgID_ MsgID `codec:"msgID" json:"msgID"`
Seqno_ int `codec:"seqno" json:"seqno"`
}
type OutOfBandMessage struct {
Uid_ UID `codec:"uid" json:"uid"`
System_ System `codec:"system" json:"system"`
Body_ Body `codec:"body" json:"body"`
}
type ReminderSet struct {
Reminders_ []Reminder `codec:"reminders" json:"reminders"`
MoreRemindersReady_ bool `codec:"moreRemindersReady" json:"moreRemindersReady"`
}
type Message struct {
Oobm_ *OutOfBandMessage `codec:"oobm,omitempty" json:"oobm,omitempty"`
Ibm_ *InBandMessage `codec:"ibm,omitempty" json:"ibm,omitempty"`
}
type DurationMsec int64
type Category string
type System string
type UID []byte
type MsgID []byte
type DeviceID []byte
type Body []byte
type Time int64
type SessionID string
type SessionToken string
type CommonInterface interface {
}
func CommonProtocol(i CommonInterface) rpc.Protocol {
return rpc.Protocol{
Name: "gregor.1.common",
Methods: map[string]rpc.ServeHandlerDescription{},
}
}
type CommonClient struct {
Cli rpc.GenericClient
}