-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtimestamp.pb.go
More file actions
193 lines (174 loc) · 4.08 KB
/
timestamp.pb.go
File metadata and controls
193 lines (174 loc) · 4.08 KB
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
// Code generated by protoc-gen-go-lite. DO NOT EDIT.
// protoc-gen-go-lite version: v0.12.1
// source: github.com/aperturerobotics/timestamp/timestamp.proto
package timestamp
import (
fmt "fmt"
io "io"
slices "slices"
strconv "strconv"
strings "strings"
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
)
// Timestamp contains a cross-platform timestamp.
// protobuf-go-lite:disable-json
type Timestamp struct {
unknownFields []byte
// TimeUnixMs timestamp in unix milliseconds.
TimeUnixMs uint64 `protobuf:"varint,1,opt,name=time_unix_ms,json=timeUnixMs,proto3" json:"timeUnixMs,omitempty"`
}
func (x *Timestamp) Reset() {
*x = Timestamp{}
}
func (*Timestamp) ProtoMessage() {}
func (x *Timestamp) GetTimeUnixMs() uint64 {
if x != nil {
return x.TimeUnixMs
}
return 0
}
func (m *Timestamp) CloneVT() *Timestamp {
if m == nil {
return (*Timestamp)(nil)
}
r := new(Timestamp)
r.TimeUnixMs = m.TimeUnixMs
if len(m.unknownFields) > 0 {
r.unknownFields = slices.Clone(m.unknownFields)
}
return r
}
func (m *Timestamp) CloneMessageVT() protobuf_go_lite.CloneMessage {
return m.CloneVT()
}
func (this *Timestamp) EqualVT(that *Timestamp) bool {
if this == that {
return true
} else if this == nil || that == nil {
return false
}
if this.TimeUnixMs != that.TimeUnixMs {
return false
}
return string(this.unknownFields) == string(that.unknownFields)
}
func (this *Timestamp) EqualMessageVT(thatMsg any) bool {
that, ok := thatMsg.(*Timestamp)
if !ok {
return false
}
return this.EqualVT(that)
}
func (m *Timestamp) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
size := m.SizeVT()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Timestamp) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *Timestamp) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
i := len(dAtA)
_ = i
var l int
_ = l
if m.unknownFields != nil {
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if m.TimeUnixMs != 0 {
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.TimeUnixMs))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *Timestamp) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.TimeUnixMs != 0 {
n += 1 + protobuf_go_lite.SizeOfVarint(uint64(m.TimeUnixMs))
}
n += len(m.unknownFields)
return n
}
func (x *Timestamp) MarshalProtoText() string {
var sb strings.Builder
sb.WriteString("Timestamp {")
if x.TimeUnixMs != 0 {
if sb.Len() > 11 {
sb.WriteString(" ")
}
sb.WriteString("time_unix_ms: ")
sb.WriteString(strconv.FormatUint(uint64(x.TimeUnixMs), 10))
}
sb.WriteString("}")
return sb.String()
}
func (x *Timestamp) String() string {
return x.MarshalProtoText()
}
func (m *Timestamp) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
var err error
for iNdEx < l {
preIndex := iNdEx
var wire uint64
wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx)
if err != nil {
return err
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Timestamp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Timestamp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixMs", wireType)
}
m.TimeUnixMs = 0
m.TimeUnixMs, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx)
if err != nil {
return err
}
default:
iNdEx = preIndex
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protobuf_go_lite.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}