forked from scionproto/scion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ack.capnp.go
170 lines (136 loc) · 4.28 KB
/
ack.capnp.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
163
164
165
166
167
168
169
170
// Code generated by capnpc-go. DO NOT EDIT.
package proto
import (
capnp "zombiezen.com/go/capnproto2"
text "zombiezen.com/go/capnproto2/encoding/text"
schemas "zombiezen.com/go/capnproto2/schemas"
)
type Ack struct{ capnp.Struct }
// Ack_TypeID is the unique identifier for the type Ack.
const Ack_TypeID = 0xf0ad983ad234aedc
func NewAck(s *capnp.Segment) (Ack, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1})
return Ack{st}, err
}
func NewRootAck(s *capnp.Segment) (Ack, error) {
st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1})
return Ack{st}, err
}
func ReadRootAck(msg *capnp.Message) (Ack, error) {
root, err := msg.RootPtr()
return Ack{root.Struct()}, err
}
func (s Ack) String() string {
str, _ := text.Marshal(0xf0ad983ad234aedc, s.Struct)
return str
}
func (s Ack) Err() Ack_ErrCode {
return Ack_ErrCode(s.Struct.Uint16(0))
}
func (s Ack) SetErr(v Ack_ErrCode) {
s.Struct.SetUint16(0, uint16(v))
}
func (s Ack) ErrDesc() (string, error) {
p, err := s.Struct.Ptr(0)
return p.Text(), err
}
func (s Ack) HasErrDesc() bool {
p, err := s.Struct.Ptr(0)
return p.IsValid() || err != nil
}
func (s Ack) ErrDescBytes() ([]byte, error) {
p, err := s.Struct.Ptr(0)
return p.TextBytes(), err
}
func (s Ack) SetErrDesc(v string) error {
return s.Struct.SetText(0, v)
}
// Ack_List is a list of Ack.
type Ack_List struct{ capnp.List }
// NewAck creates a new list of Ack.
func NewAck_List(s *capnp.Segment, sz int32) (Ack_List, error) {
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz)
return Ack_List{l}, err
}
func (s Ack_List) At(i int) Ack { return Ack{s.List.Struct(i)} }
func (s Ack_List) Set(i int, v Ack) error { return s.List.SetStruct(i, v.Struct) }
func (s Ack_List) String() string {
str, _ := text.MarshalList(0xf0ad983ad234aedc, s.List)
return str
}
// Ack_Promise is a wrapper for a Ack promised by a client call.
type Ack_Promise struct{ *capnp.Pipeline }
func (p Ack_Promise) Struct() (Ack, error) {
s, err := p.Pipeline.Struct()
return Ack{s}, err
}
type Ack_ErrCode uint16
// Ack_ErrCode_TypeID is the unique identifier for the type Ack_ErrCode.
const Ack_ErrCode_TypeID = 0xdf6d763cff9bd528
// Values of Ack_ErrCode.
const (
Ack_ErrCode_ok Ack_ErrCode = 0
Ack_ErrCode_retry Ack_ErrCode = 1
Ack_ErrCode_reject Ack_ErrCode = 2
)
// String returns the enum's constant name.
func (c Ack_ErrCode) String() string {
switch c {
case Ack_ErrCode_ok:
return "ok"
case Ack_ErrCode_retry:
return "retry"
case Ack_ErrCode_reject:
return "reject"
default:
return ""
}
}
// Ack_ErrCodeFromString returns the enum value with a name,
// or the zero value if there's no such value.
func Ack_ErrCodeFromString(c string) Ack_ErrCode {
switch c {
case "ok":
return Ack_ErrCode_ok
case "retry":
return Ack_ErrCode_retry
case "reject":
return Ack_ErrCode_reject
default:
return 0
}
}
type Ack_ErrCode_List struct{ capnp.List }
func NewAck_ErrCode_List(s *capnp.Segment, sz int32) (Ack_ErrCode_List, error) {
l, err := capnp.NewUInt16List(s, sz)
return Ack_ErrCode_List{l.List}, err
}
func (l Ack_ErrCode_List) At(i int) Ack_ErrCode {
ul := capnp.UInt16List{List: l.List}
return Ack_ErrCode(ul.At(i))
}
func (l Ack_ErrCode_List) Set(i int, v Ack_ErrCode) {
ul := capnp.UInt16List{List: l.List}
ul.Set(i, uint16(v))
}
const schema_c736b44d517db44a = "x\xdaL\xce1J\x03a\x14\x04\xe0\x99\x7fwM\x90" +
"\xd5\xf8@\x11\x04Y\x10\x8bX\x18D\x82\xc5\"h\xa2" +
"[(\x88y\xa5\x85EX\xff\xc6E\x13\x9eA\xb1\x90" +
"\\C\xf0\x0cZH\xc0#\xd8\x0bv\x82W\xf0\x06+" +
"Ialg\x86\x8fY\xe8\xec;\x89\xde\x00\xadF3" +
"e\xfd\xf3\xa9\xdc\xbd\xbd\xfa\x86\xcc\xbb\xf2\xeb\xa5\xf9\x91" +
">>\xff\x00\x94\xd6\xab\x1cU\x00\xc9N\xc1i\xa1\xb3" +
"dy<z\xd0\x93\xd1\xce;\"\x8e\x17g&\xe7\xcb" +
"\x80\xf8;\xb0\xec\xe6E#\xef\xf6\xaf\xd9O[y\xd1" +
"\xc8,\xb1\x83\xde\x85\xef\x90\x1a\xd3\x01\xb2\xba\x02\x90\xb2" +
"\xb4\x0d\xd0\xc9\\\x0a\x04\xbd\"1?\xb0\xfb=\xf3\x97" +
">\x1f\xfc\x19H&\x88\x86\xe4\xbf\x9fl\x0f3\x9b\xa0" +
"Z\x0dB $ \x1bk\x80\xae\x07\xd4-Gr\x91" +
"\xe3l\xb3\x0dh=\xa06\x1d+\xde\x8c\xb5\xa9\x02\xb2" +
"\x06\x0e\xbd\xd9\xa1\xbf\xc9\x19\xc31\x06\x7f\x03\x00\x00\xff" +
"\xff)\xe3JV"
func init() {
schemas.Register(schema_c736b44d517db44a,
0xdf6d763cff9bd528,
0xf0ad983ad234aedc)
}