forked from keybase/client
/
reset.go
132 lines (111 loc) · 3.05 KB
/
reset.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
// Auto-generated by avdl-compiler v1.4.0 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/keybase1/reset.avdl
package keybase1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type SHA512 []byte
func (o SHA512) DeepCopy() SHA512 {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type ResetType int
const (
ResetType_NONE ResetType = 0
ResetType_RESET ResetType = 1
ResetType_DELETE ResetType = 2
)
func (o ResetType) DeepCopy() ResetType { return o }
var ResetTypeMap = map[string]ResetType{
"NONE": 0,
"RESET": 1,
"DELETE": 2,
}
var ResetTypeRevMap = map[ResetType]string{
0: "NONE",
1: "RESET",
2: "DELETE",
}
func (e ResetType) String() string {
if v, ok := ResetTypeRevMap[e]; ok {
return v
}
return ""
}
type ResetMerkleRoot struct {
HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"`
Seqno Seqno `codec:"seqno" json:"seqno"`
}
func (o ResetMerkleRoot) DeepCopy() ResetMerkleRoot {
return ResetMerkleRoot{
HashMeta: o.HashMeta.DeepCopy(),
Seqno: o.Seqno.DeepCopy(),
}
}
type ResetPrev struct {
EldestKID *KID `codec:"eldestKID,omitempty" json:"eldest_kid,omitempty"`
LastSeqno Seqno `codec:"lastSeqno" json:"public_seqno"`
Reset SHA512 `codec:"reset" json:"reset"`
}
func (o ResetPrev) DeepCopy() ResetPrev {
return ResetPrev{
EldestKID: (func(x *KID) *KID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.EldestKID),
LastSeqno: o.LastSeqno.DeepCopy(),
Reset: o.Reset.DeepCopy(),
}
}
type ResetLink struct {
Ctime UnixTime `codec:"ctime" json:"ctime"`
MerkleRoot ResetMerkleRoot `codec:"merkleRoot" json:"merkle_root"`
Prev ResetPrev `codec:"prev" json:"prev"`
ResetSeqno Seqno `codec:"resetSeqno" json:"reset_seqno"`
Type ResetType `codec:"type" json:"type"`
Uid UID `codec:"uid" json:"uid"`
}
func (o ResetLink) DeepCopy() ResetLink {
return ResetLink{
Ctime: o.Ctime.DeepCopy(),
MerkleRoot: o.MerkleRoot.DeepCopy(),
Prev: o.Prev.DeepCopy(),
ResetSeqno: o.ResetSeqno.DeepCopy(),
Type: o.Type.DeepCopy(),
Uid: o.Uid.DeepCopy(),
}
}
type ResetSummary struct {
Ctime UnixTime `codec:"ctime" json:"ctime"`
MerkleRoot ResetMerkleRoot `codec:"merkleRoot" json:"merkleRoot"`
ResetSeqno Seqno `codec:"resetSeqno" json:"resetSeqno"`
EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"`
Type ResetType `codec:"type" json:"type"`
}
func (o ResetSummary) DeepCopy() ResetSummary {
return ResetSummary{
Ctime: o.Ctime.DeepCopy(),
MerkleRoot: o.MerkleRoot.DeepCopy(),
ResetSeqno: o.ResetSeqno.DeepCopy(),
EldestSeqno: o.EldestSeqno.DeepCopy(),
Type: o.Type.DeepCopy(),
}
}
type ResetInterface interface {
}
func ResetProtocol(i ResetInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.Reset",
Methods: map[string]rpc.ServeHandlerDescription{},
}
}
type ResetClient struct {
Cli rpc.GenericClient
}