forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.pb.go
426 lines (404 loc) · 10.2 KB
/
log.pb.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
// Code generated by protoc-gen-gogo.
// source: log.proto
// DO NOT EDIT!
package events
import proto "github.com/gogo/protobuf/proto"
import math "math"
// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb"
import io "io"
import fmt "fmt"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = math.Inf
// / MessageType stores the destination of the message (corresponding to STDOUT or STDERR).
type LogMessage_MessageType int32
const (
LogMessage_OUT LogMessage_MessageType = 1
LogMessage_ERR LogMessage_MessageType = 2
)
var LogMessage_MessageType_name = map[int32]string{
1: "OUT",
2: "ERR",
}
var LogMessage_MessageType_value = map[string]int32{
"OUT": 1,
"ERR": 2,
}
func (x LogMessage_MessageType) Enum() *LogMessage_MessageType {
p := new(LogMessage_MessageType)
*p = x
return p
}
func (x LogMessage_MessageType) String() string {
return proto.EnumName(LogMessage_MessageType_name, int32(x))
}
func (x *LogMessage_MessageType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(LogMessage_MessageType_value, data, "LogMessage_MessageType")
if err != nil {
return err
}
*x = LogMessage_MessageType(value)
return nil
}
// / A LogMessage contains a "log line" and associated metadata.
type LogMessage struct {
Message []byte `protobuf:"bytes,1,req,name=message" json:"message,omitempty"`
MessageType *LogMessage_MessageType `protobuf:"varint,2,req,name=message_type,enum=events.LogMessage_MessageType" json:"message_type,omitempty"`
Timestamp *int64 `protobuf:"varint,3,req,name=timestamp" json:"timestamp,omitempty"`
AppId *string `protobuf:"bytes,4,opt,name=app_id" json:"app_id,omitempty"`
SourceType *string `protobuf:"bytes,5,opt,name=source_type" json:"source_type,omitempty"`
SourceInstance *string `protobuf:"bytes,6,opt,name=source_instance" json:"source_instance,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *LogMessage) Reset() { *m = LogMessage{} }
func (m *LogMessage) String() string { return proto.CompactTextString(m) }
func (*LogMessage) ProtoMessage() {}
func (m *LogMessage) GetMessage() []byte {
if m != nil {
return m.Message
}
return nil
}
func (m *LogMessage) GetMessageType() LogMessage_MessageType {
if m != nil && m.MessageType != nil {
return *m.MessageType
}
return LogMessage_OUT
}
func (m *LogMessage) GetTimestamp() int64 {
if m != nil && m.Timestamp != nil {
return *m.Timestamp
}
return 0
}
func (m *LogMessage) GetAppId() string {
if m != nil && m.AppId != nil {
return *m.AppId
}
return ""
}
func (m *LogMessage) GetSourceType() string {
if m != nil && m.SourceType != nil {
return *m.SourceType
}
return ""
}
func (m *LogMessage) GetSourceInstance() string {
if m != nil && m.SourceInstance != nil {
return *m.SourceInstance
}
return ""
}
func init() {
proto.RegisterEnum("events.LogMessage_MessageType", LogMessage_MessageType_name, LogMessage_MessageType_value)
}
func (m *LogMessage) Unmarshal(data []byte) error {
var hasFields [1]uint64
l := len(data)
index := 0
for index < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
byteLen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
postIndex := index + byteLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Message = append([]byte{}, data[index:postIndex]...)
index = postIndex
hasFields[0] |= uint64(0x00000001)
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MessageType", wireType)
}
var v LogMessage_MessageType
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
v |= (LogMessage_MessageType(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.MessageType = &v
hasFields[0] |= uint64(0x00000002)
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
}
var v int64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Timestamp = &v
hasFields[0] |= uint64(0x00000004)
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
postIndex := index + int(stringLen)
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[index:postIndex])
m.AppId = &s
index = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SourceType", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
postIndex := index + int(stringLen)
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[index:postIndex])
m.SourceType = &s
index = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SourceInstance", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io.ErrUnexpectedEOF
}
b := data[index]
index++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
postIndex := index + int(stringLen)
if postIndex > l {
return io.ErrUnexpectedEOF
}
s := string(data[index:postIndex])
m.SourceInstance = &s
index = postIndex
default:
var sizeOfWire int
for {
sizeOfWire++
wire >>= 7
if wire == 0 {
break
}
}
index -= sizeOfWire
skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
if err != nil {
return err
}
if (index + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
index += skippy
}
}
if hasFields[0]&uint64(0x00000001) == 0 {
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message")
}
if hasFields[0]&uint64(0x00000002) == 0 {
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message_type")
}
if hasFields[0]&uint64(0x00000004) == 0 {
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp")
}
return nil
}
func (m *LogMessage) Size() (n int) {
var l int
_ = l
if m.Message != nil {
l = len(m.Message)
n += 1 + l + sovLog(uint64(l))
}
if m.MessageType != nil {
n += 1 + sovLog(uint64(*m.MessageType))
}
if m.Timestamp != nil {
n += 1 + sovLog(uint64(*m.Timestamp))
}
if m.AppId != nil {
l = len(*m.AppId)
n += 1 + l + sovLog(uint64(l))
}
if m.SourceType != nil {
l = len(*m.SourceType)
n += 1 + l + sovLog(uint64(l))
}
if m.SourceInstance != nil {
l = len(*m.SourceInstance)
n += 1 + l + sovLog(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovLog(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozLog(x uint64) (n int) {
return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *LogMessage) Marshal() (data []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
if err != nil {
return nil, err
}
return data[:n], nil
}
func (m *LogMessage) MarshalTo(data []byte) (n int, err error) {
var i int
_ = i
var l int
_ = l
if m.Message == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message")
} else {
data[i] = 0xa
i++
i = encodeVarintLog(data, i, uint64(len(m.Message)))
i += copy(data[i:], m.Message)
}
if m.MessageType == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message_type")
} else {
data[i] = 0x10
i++
i = encodeVarintLog(data, i, uint64(*m.MessageType))
}
if m.Timestamp == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp")
} else {
data[i] = 0x18
i++
i = encodeVarintLog(data, i, uint64(*m.Timestamp))
}
if m.AppId != nil {
data[i] = 0x22
i++
i = encodeVarintLog(data, i, uint64(len(*m.AppId)))
i += copy(data[i:], *m.AppId)
}
if m.SourceType != nil {
data[i] = 0x2a
i++
i = encodeVarintLog(data, i, uint64(len(*m.SourceType)))
i += copy(data[i:], *m.SourceType)
}
if m.SourceInstance != nil {
data[i] = 0x32
i++
i = encodeVarintLog(data, i, uint64(len(*m.SourceInstance)))
i += copy(data[i:], *m.SourceInstance)
}
if m.XXX_unrecognized != nil {
i += copy(data[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64Log(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Log(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintLog(data []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
return offset + 1
}