starpc 0.41.2 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -20
- package/dist/mock/mock.pb.d.ts +1 -1
- package/dist/mock/mock.pb.js +4 -5
- package/dist/mock/mock_srpc.pb.d.ts +3 -3
- package/dist/mock/mock_srpc.pb.js +5 -5
- package/echo/Cargo.toml +21 -0
- package/echo/build.rs +15 -0
- package/echo/echo.pb.cc +405 -0
- package/echo/echo.pb.go +9 -27
- package/echo/echo.pb.h +364 -0
- package/echo/echo_srpc.pb.go +1 -1
- package/echo/gen/mod.rs +3 -0
- package/echo/main.rs +162 -0
- package/go.mod +18 -10
- package/go.sum +28 -18
- package/mock/mock.pb.cc +394 -0
- package/mock/mock.pb.go +9 -27
- package/mock/mock.pb.h +366 -0
- package/mock/mock.pb.ts +11 -13
- package/mock/mock_srpc.pb.go +1 -1
- package/mock/mock_srpc.pb.ts +12 -9
- package/package.json +27 -25
- package/srpc/Cargo.toml +26 -0
- package/srpc/build.rs +15 -0
- package/srpc/client.rs +356 -0
- package/srpc/codec.rs +225 -0
- package/srpc/error.rs +177 -0
- package/srpc/handler.rs +163 -0
- package/srpc/invoker.rs +192 -0
- package/srpc/lib.rs +107 -0
- package/srpc/message.rs +9 -0
- package/srpc/mux.rs +353 -0
- package/srpc/packet.rs +334 -0
- package/srpc/proto/mod.rs +10 -0
- package/srpc/rpc.rs +777 -0
- package/srpc/rpcproto.pb.cc +1381 -0
- package/srpc/rpcproto.pb.go +75 -183
- package/srpc/rpcproto.pb.h +1451 -0
- package/srpc/server.rs +337 -0
- package/srpc/stream.rs +304 -0
- package/srpc/testing.rs +290 -0
- package/srpc/tests/integration_test.rs +495 -0
- package/srpc/transport.rs +218 -0
- package/Makefile +0 -154
package/mock/mock.pb.cc
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
//go:build deps_only && cgo
|
|
2
|
+
|
|
3
|
+
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
4
|
+
// NO CHECKED-IN PROTOBUF GENCODE
|
|
5
|
+
// source: github.com/aperturerobotics/starpc/mock/mock.proto
|
|
6
|
+
// Protobuf C++ Version: 6.33.4
|
|
7
|
+
|
|
8
|
+
#include "mock.pb.h"
|
|
9
|
+
|
|
10
|
+
#include <algorithm>
|
|
11
|
+
#include <type_traits>
|
|
12
|
+
#include "google/protobuf/io/coded_stream.h"
|
|
13
|
+
#include "google/protobuf/generated_message_tctable_impl.h"
|
|
14
|
+
#include "google/protobuf/extension_set.h"
|
|
15
|
+
#include "google/protobuf/generated_message_util.h"
|
|
16
|
+
#include "google/protobuf/wire_format_lite.h"
|
|
17
|
+
#include "google/protobuf/descriptor.h"
|
|
18
|
+
#include "google/protobuf/generated_message_reflection.h"
|
|
19
|
+
#include "google/protobuf/reflection_ops.h"
|
|
20
|
+
#include "google/protobuf/wire_format.h"
|
|
21
|
+
// @@protoc_insertion_point(includes)
|
|
22
|
+
|
|
23
|
+
// Must be included last.
|
|
24
|
+
#include "google/protobuf/port_def.inc"
|
|
25
|
+
PROTOBUF_PRAGMA_INIT_SEG
|
|
26
|
+
namespace _pb = ::google::protobuf;
|
|
27
|
+
namespace _pbi = ::google::protobuf::internal;
|
|
28
|
+
namespace _fl = ::google::protobuf::internal::field_layout;
|
|
29
|
+
namespace e2e {
|
|
30
|
+
namespace mock {
|
|
31
|
+
|
|
32
|
+
inline constexpr MockMsg::Impl_::Impl_(
|
|
33
|
+
::_pbi::ConstantInitialized) noexcept
|
|
34
|
+
: _cached_size_{0},
|
|
35
|
+
body_(
|
|
36
|
+
&::google::protobuf::internal::fixed_address_empty_string,
|
|
37
|
+
::_pbi::ConstantInitialized()) {}
|
|
38
|
+
|
|
39
|
+
template <typename>
|
|
40
|
+
PROTOBUF_CONSTEXPR MockMsg::MockMsg(::_pbi::ConstantInitialized)
|
|
41
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
42
|
+
: ::google::protobuf::Message(MockMsg_class_data_.base()),
|
|
43
|
+
#else // PROTOBUF_CUSTOM_VTABLE
|
|
44
|
+
: ::google::protobuf::Message(),
|
|
45
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
46
|
+
_impl_(::_pbi::ConstantInitialized()) {
|
|
47
|
+
}
|
|
48
|
+
struct MockMsgDefaultTypeInternal {
|
|
49
|
+
PROTOBUF_CONSTEXPR MockMsgDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
|
|
50
|
+
~MockMsgDefaultTypeInternal() {}
|
|
51
|
+
union {
|
|
52
|
+
MockMsg _instance;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
|
|
57
|
+
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MockMsgDefaultTypeInternal _MockMsg_default_instance_;
|
|
58
|
+
} // namespace mock
|
|
59
|
+
} // namespace e2e
|
|
60
|
+
static constexpr const ::_pb::EnumDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE
|
|
61
|
+
file_level_enum_descriptors_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto = nullptr;
|
|
62
|
+
static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE
|
|
63
|
+
file_level_service_descriptors_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto = nullptr;
|
|
64
|
+
const ::uint32_t
|
|
65
|
+
TableStruct_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
|
|
66
|
+
protodesc_cold) = {
|
|
67
|
+
0x081, // bitmap
|
|
68
|
+
PROTOBUF_FIELD_OFFSET(::e2e::mock::MockMsg, _impl_._has_bits_),
|
|
69
|
+
4, // hasbit index offset
|
|
70
|
+
PROTOBUF_FIELD_OFFSET(::e2e::mock::MockMsg, _impl_.body_),
|
|
71
|
+
0,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
static const ::_pbi::MigrationSchema
|
|
75
|
+
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
|
|
76
|
+
{0, sizeof(::e2e::mock::MockMsg)},
|
|
77
|
+
};
|
|
78
|
+
static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = {
|
|
79
|
+
&::e2e::mock::_MockMsg_default_instance_._instance,
|
|
80
|
+
};
|
|
81
|
+
const char descriptor_table_protodef_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
|
|
82
|
+
protodesc_cold) = {
|
|
83
|
+
"\n2github.com/aperturerobotics/starpc/moc"
|
|
84
|
+
"k/mock.proto\022\010e2e.mock\"\027\n\007MockMsg\022\014\n\004bod"
|
|
85
|
+
"y\030\001 \001(\t2;\n\004Mock\0223\n\013MockRequest\022\021.e2e.moc"
|
|
86
|
+
"k.MockMsg\032\021.e2e.mock.MockMsgb\006proto3"
|
|
87
|
+
};
|
|
88
|
+
static ::absl::once_flag descriptor_table_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto_once;
|
|
89
|
+
PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto = {
|
|
90
|
+
false,
|
|
91
|
+
false,
|
|
92
|
+
156,
|
|
93
|
+
descriptor_table_protodef_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto,
|
|
94
|
+
"github.com/aperturerobotics/starpc/mock/mock.proto",
|
|
95
|
+
&descriptor_table_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto_once,
|
|
96
|
+
nullptr,
|
|
97
|
+
0,
|
|
98
|
+
1,
|
|
99
|
+
schemas,
|
|
100
|
+
file_default_instances,
|
|
101
|
+
TableStruct_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto::offsets,
|
|
102
|
+
file_level_enum_descriptors_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto,
|
|
103
|
+
file_level_service_descriptors_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto,
|
|
104
|
+
};
|
|
105
|
+
namespace e2e {
|
|
106
|
+
namespace mock {
|
|
107
|
+
// ===================================================================
|
|
108
|
+
|
|
109
|
+
class MockMsg::_Internal {
|
|
110
|
+
public:
|
|
111
|
+
using HasBits =
|
|
112
|
+
decltype(::std::declval<MockMsg>()._impl_._has_bits_);
|
|
113
|
+
static constexpr ::int32_t kHasBitsOffset =
|
|
114
|
+
8 * PROTOBUF_FIELD_OFFSET(MockMsg, _impl_._has_bits_);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
MockMsg::MockMsg(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
|
|
118
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
119
|
+
: ::google::protobuf::Message(arena, MockMsg_class_data_.base()) {
|
|
120
|
+
#else // PROTOBUF_CUSTOM_VTABLE
|
|
121
|
+
: ::google::protobuf::Message(arena) {
|
|
122
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
123
|
+
SharedCtor(arena);
|
|
124
|
+
// @@protoc_insertion_point(arena_constructor:e2e.mock.MockMsg)
|
|
125
|
+
}
|
|
126
|
+
PROTOBUF_NDEBUG_INLINE MockMsg::Impl_::Impl_(
|
|
127
|
+
[[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
|
|
128
|
+
[[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
|
|
129
|
+
[[maybe_unused]] const ::e2e::mock::MockMsg& from_msg)
|
|
130
|
+
: _has_bits_{from._has_bits_},
|
|
131
|
+
_cached_size_{0},
|
|
132
|
+
body_(arena, from.body_) {}
|
|
133
|
+
|
|
134
|
+
MockMsg::MockMsg(
|
|
135
|
+
::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
|
|
136
|
+
const MockMsg& from)
|
|
137
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
138
|
+
: ::google::protobuf::Message(arena, MockMsg_class_data_.base()) {
|
|
139
|
+
#else // PROTOBUF_CUSTOM_VTABLE
|
|
140
|
+
: ::google::protobuf::Message(arena) {
|
|
141
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
142
|
+
MockMsg* const _this = this;
|
|
143
|
+
(void)_this;
|
|
144
|
+
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
|
|
145
|
+
from._internal_metadata_);
|
|
146
|
+
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
|
|
147
|
+
|
|
148
|
+
// @@protoc_insertion_point(copy_constructor:e2e.mock.MockMsg)
|
|
149
|
+
}
|
|
150
|
+
PROTOBUF_NDEBUG_INLINE MockMsg::Impl_::Impl_(
|
|
151
|
+
[[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
|
|
152
|
+
[[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
|
|
153
|
+
: _cached_size_{0},
|
|
154
|
+
body_(arena) {}
|
|
155
|
+
|
|
156
|
+
inline void MockMsg::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
|
|
157
|
+
new (&_impl_) Impl_(internal_visibility(), arena);
|
|
158
|
+
}
|
|
159
|
+
MockMsg::~MockMsg() {
|
|
160
|
+
// @@protoc_insertion_point(destructor:e2e.mock.MockMsg)
|
|
161
|
+
SharedDtor(*this);
|
|
162
|
+
}
|
|
163
|
+
inline void MockMsg::SharedDtor(MessageLite& self) {
|
|
164
|
+
MockMsg& this_ = static_cast<MockMsg&>(self);
|
|
165
|
+
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
|
|
166
|
+
this_.CheckHasBitConsistency();
|
|
167
|
+
}
|
|
168
|
+
this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
|
|
169
|
+
ABSL_DCHECK(this_.GetArena() == nullptr);
|
|
170
|
+
this_._impl_.body_.Destroy();
|
|
171
|
+
this_._impl_.~Impl_();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
inline void* PROTOBUF_NONNULL MockMsg::PlacementNew_(
|
|
175
|
+
const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
|
|
176
|
+
::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
|
|
177
|
+
return ::new (mem) MockMsg(arena);
|
|
178
|
+
}
|
|
179
|
+
constexpr auto MockMsg::InternalNewImpl_() {
|
|
180
|
+
return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(MockMsg),
|
|
181
|
+
alignof(MockMsg));
|
|
182
|
+
}
|
|
183
|
+
constexpr auto MockMsg::InternalGenerateClassData_() {
|
|
184
|
+
return ::google::protobuf::internal::ClassDataFull{
|
|
185
|
+
::google::protobuf::internal::ClassData{
|
|
186
|
+
&_MockMsg_default_instance_._instance,
|
|
187
|
+
&_table_.header,
|
|
188
|
+
nullptr, // OnDemandRegisterArenaDtor
|
|
189
|
+
nullptr, // IsInitialized
|
|
190
|
+
&MockMsg::MergeImpl,
|
|
191
|
+
::google::protobuf::Message::GetNewImpl<MockMsg>(),
|
|
192
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
193
|
+
&MockMsg::SharedDtor,
|
|
194
|
+
::google::protobuf::Message::GetClearImpl<MockMsg>(), &MockMsg::ByteSizeLong,
|
|
195
|
+
&MockMsg::_InternalSerialize,
|
|
196
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
197
|
+
PROTOBUF_FIELD_OFFSET(MockMsg, _impl_._cached_size_),
|
|
198
|
+
false,
|
|
199
|
+
},
|
|
200
|
+
&MockMsg::kDescriptorMethods,
|
|
201
|
+
&descriptor_table_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto,
|
|
202
|
+
nullptr, // tracker
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const
|
|
207
|
+
::google::protobuf::internal::ClassDataFull MockMsg_class_data_ =
|
|
208
|
+
MockMsg::InternalGenerateClassData_();
|
|
209
|
+
|
|
210
|
+
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
|
|
211
|
+
MockMsg::GetClassData() const {
|
|
212
|
+
::google::protobuf::internal::PrefetchToLocalCache(&MockMsg_class_data_);
|
|
213
|
+
::google::protobuf::internal::PrefetchToLocalCache(MockMsg_class_data_.tc_table);
|
|
214
|
+
return MockMsg_class_data_.base();
|
|
215
|
+
}
|
|
216
|
+
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
|
|
217
|
+
const ::_pbi::TcParseTable<0, 1, 0, 29, 2>
|
|
218
|
+
MockMsg::_table_ = {
|
|
219
|
+
{
|
|
220
|
+
PROTOBUF_FIELD_OFFSET(MockMsg, _impl_._has_bits_),
|
|
221
|
+
0, // no _extensions_
|
|
222
|
+
1, 0, // max_field_number, fast_idx_mask
|
|
223
|
+
offsetof(decltype(_table_), field_lookup_table),
|
|
224
|
+
4294967294, // skipmap
|
|
225
|
+
offsetof(decltype(_table_), field_entries),
|
|
226
|
+
1, // num_field_entries
|
|
227
|
+
0, // num_aux_entries
|
|
228
|
+
offsetof(decltype(_table_), field_names), // no aux_entries
|
|
229
|
+
MockMsg_class_data_.base(),
|
|
230
|
+
nullptr, // post_loop_handler
|
|
231
|
+
::_pbi::TcParser::GenericFallback, // fallback
|
|
232
|
+
#ifdef PROTOBUF_PREFETCH_PARSE_TABLE
|
|
233
|
+
::_pbi::TcParser::GetTable<::e2e::mock::MockMsg>(), // to_prefetch
|
|
234
|
+
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
|
|
235
|
+
}, {{
|
|
236
|
+
// string body = 1;
|
|
237
|
+
{::_pbi::TcParser::FastUS1,
|
|
238
|
+
{10, 0, 0,
|
|
239
|
+
PROTOBUF_FIELD_OFFSET(MockMsg, _impl_.body_)}},
|
|
240
|
+
}}, {{
|
|
241
|
+
65535, 65535
|
|
242
|
+
}}, {{
|
|
243
|
+
// string body = 1;
|
|
244
|
+
{PROTOBUF_FIELD_OFFSET(MockMsg, _impl_.body_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)},
|
|
245
|
+
}},
|
|
246
|
+
// no aux_entries
|
|
247
|
+
{{
|
|
248
|
+
"\20\4\0\0\0\0\0\0"
|
|
249
|
+
"e2e.mock.MockMsg"
|
|
250
|
+
"body"
|
|
251
|
+
}},
|
|
252
|
+
};
|
|
253
|
+
PROTOBUF_NOINLINE void MockMsg::Clear() {
|
|
254
|
+
// @@protoc_insertion_point(message_clear_start:e2e.mock.MockMsg)
|
|
255
|
+
::google::protobuf::internal::TSanWrite(&_impl_);
|
|
256
|
+
::uint32_t cached_has_bits = 0;
|
|
257
|
+
// Prevent compiler warnings about cached_has_bits being unused
|
|
258
|
+
(void) cached_has_bits;
|
|
259
|
+
|
|
260
|
+
cached_has_bits = _impl_._has_bits_[0];
|
|
261
|
+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
|
|
262
|
+
_impl_.body_.ClearNonDefaultToEmpty();
|
|
263
|
+
}
|
|
264
|
+
_impl_._has_bits_.Clear();
|
|
265
|
+
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
269
|
+
::uint8_t* PROTOBUF_NONNULL MockMsg::_InternalSerialize(
|
|
270
|
+
const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
|
|
271
|
+
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
|
|
272
|
+
const MockMsg& this_ = static_cast<const MockMsg&>(base);
|
|
273
|
+
#else // PROTOBUF_CUSTOM_VTABLE
|
|
274
|
+
::uint8_t* PROTOBUF_NONNULL MockMsg::_InternalSerialize(
|
|
275
|
+
::uint8_t* PROTOBUF_NONNULL target,
|
|
276
|
+
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
|
|
277
|
+
const MockMsg& this_ = *this;
|
|
278
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
279
|
+
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
|
|
280
|
+
this_.CheckHasBitConsistency();
|
|
281
|
+
}
|
|
282
|
+
// @@protoc_insertion_point(serialize_to_array_start:e2e.mock.MockMsg)
|
|
283
|
+
::uint32_t cached_has_bits = 0;
|
|
284
|
+
(void)cached_has_bits;
|
|
285
|
+
|
|
286
|
+
cached_has_bits = this_._impl_._has_bits_[0];
|
|
287
|
+
// string body = 1;
|
|
288
|
+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
|
|
289
|
+
if (!this_._internal_body().empty()) {
|
|
290
|
+
const ::std::string& _s = this_._internal_body();
|
|
291
|
+
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
|
292
|
+
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "e2e.mock.MockMsg.body");
|
|
293
|
+
target = stream->WriteStringMaybeAliased(1, _s, target);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
|
|
298
|
+
target =
|
|
299
|
+
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
|
300
|
+
this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
|
|
301
|
+
}
|
|
302
|
+
// @@protoc_insertion_point(serialize_to_array_end:e2e.mock.MockMsg)
|
|
303
|
+
return target;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
#if defined(PROTOBUF_CUSTOM_VTABLE)
|
|
307
|
+
::size_t MockMsg::ByteSizeLong(const MessageLite& base) {
|
|
308
|
+
const MockMsg& this_ = static_cast<const MockMsg&>(base);
|
|
309
|
+
#else // PROTOBUF_CUSTOM_VTABLE
|
|
310
|
+
::size_t MockMsg::ByteSizeLong() const {
|
|
311
|
+
const MockMsg& this_ = *this;
|
|
312
|
+
#endif // PROTOBUF_CUSTOM_VTABLE
|
|
313
|
+
// @@protoc_insertion_point(message_byte_size_start:e2e.mock.MockMsg)
|
|
314
|
+
::size_t total_size = 0;
|
|
315
|
+
|
|
316
|
+
::uint32_t cached_has_bits = 0;
|
|
317
|
+
// Prevent compiler warnings about cached_has_bits being unused
|
|
318
|
+
(void)cached_has_bits;
|
|
319
|
+
|
|
320
|
+
{
|
|
321
|
+
// string body = 1;
|
|
322
|
+
cached_has_bits = this_._impl_._has_bits_[0];
|
|
323
|
+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
|
|
324
|
+
if (!this_._internal_body().empty()) {
|
|
325
|
+
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
|
|
326
|
+
this_._internal_body());
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return this_.MaybeComputeUnknownFieldsSize(total_size,
|
|
331
|
+
&this_._impl_._cached_size_);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
void MockMsg::MergeImpl(::google::protobuf::MessageLite& to_msg,
|
|
335
|
+
const ::google::protobuf::MessageLite& from_msg) {
|
|
336
|
+
auto* const _this =
|
|
337
|
+
static_cast<MockMsg*>(&to_msg);
|
|
338
|
+
auto& from = static_cast<const MockMsg&>(from_msg);
|
|
339
|
+
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
|
|
340
|
+
from.CheckHasBitConsistency();
|
|
341
|
+
}
|
|
342
|
+
// @@protoc_insertion_point(class_specific_merge_from_start:e2e.mock.MockMsg)
|
|
343
|
+
ABSL_DCHECK_NE(&from, _this);
|
|
344
|
+
::uint32_t cached_has_bits = 0;
|
|
345
|
+
(void)cached_has_bits;
|
|
346
|
+
|
|
347
|
+
cached_has_bits = from._impl_._has_bits_[0];
|
|
348
|
+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
|
|
349
|
+
if (!from._internal_body().empty()) {
|
|
350
|
+
_this->_internal_set_body(from._internal_body());
|
|
351
|
+
} else {
|
|
352
|
+
if (_this->_impl_.body_.IsDefault()) {
|
|
353
|
+
_this->_internal_set_body("");
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
_this->_impl_._has_bits_[0] |= cached_has_bits;
|
|
358
|
+
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
|
|
359
|
+
from._internal_metadata_);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
void MockMsg::CopyFrom(const MockMsg& from) {
|
|
363
|
+
// @@protoc_insertion_point(class_specific_copy_from_start:e2e.mock.MockMsg)
|
|
364
|
+
if (&from == this) return;
|
|
365
|
+
Clear();
|
|
366
|
+
MergeFrom(from);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
void MockMsg::InternalSwap(MockMsg* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
|
|
371
|
+
using ::std::swap;
|
|
372
|
+
auto* arena = GetArena();
|
|
373
|
+
ABSL_DCHECK_EQ(arena, other->GetArena());
|
|
374
|
+
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
|
|
375
|
+
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
|
|
376
|
+
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.body_, &other->_impl_.body_, arena);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
::google::protobuf::Metadata MockMsg::GetMetadata() const {
|
|
380
|
+
return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full());
|
|
381
|
+
}
|
|
382
|
+
// @@protoc_insertion_point(namespace_scope)
|
|
383
|
+
} // namespace mock
|
|
384
|
+
} // namespace e2e
|
|
385
|
+
namespace google {
|
|
386
|
+
namespace protobuf {
|
|
387
|
+
} // namespace protobuf
|
|
388
|
+
} // namespace google
|
|
389
|
+
// @@protoc_insertion_point(global_scope)
|
|
390
|
+
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::std::false_type
|
|
391
|
+
_static_init2_ [[maybe_unused]] =
|
|
392
|
+
(::_pbi::AddDescriptors(&descriptor_table_github_2ecom_2faperturerobotics_2fstarpc_2fmock_2fmock_2eproto),
|
|
393
|
+
::std::false_type{});
|
|
394
|
+
#include "google/protobuf/port_undef.inc"
|
package/mock/mock.pb.go
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Code generated by protoc-gen-go-lite. DO NOT EDIT.
|
|
2
|
-
// protoc-gen-go-lite version: v0.
|
|
2
|
+
// protoc-gen-go-lite version: v0.12.0
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/mock/mock.proto
|
|
4
4
|
|
|
5
5
|
package e2e_mock
|
|
@@ -183,25 +183,17 @@ func (x *MockMsg) MarshalProtoText() string {
|
|
|
183
183
|
func (x *MockMsg) String() string {
|
|
184
184
|
return x.MarshalProtoText()
|
|
185
185
|
}
|
|
186
|
+
|
|
186
187
|
func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
187
188
|
l := len(dAtA)
|
|
188
189
|
iNdEx := 0
|
|
190
|
+
var err error
|
|
189
191
|
for iNdEx < l {
|
|
190
192
|
preIndex := iNdEx
|
|
191
193
|
var wire uint64
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
if iNdEx >= l {
|
|
197
|
-
return io.ErrUnexpectedEOF
|
|
198
|
-
}
|
|
199
|
-
b := dAtA[iNdEx]
|
|
200
|
-
iNdEx++
|
|
201
|
-
wire |= uint64(b&0x7F) << shift
|
|
202
|
-
if b < 0x80 {
|
|
203
|
-
break
|
|
204
|
-
}
|
|
194
|
+
wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx)
|
|
195
|
+
if err != nil {
|
|
196
|
+
return err
|
|
205
197
|
}
|
|
206
198
|
fieldNum := int32(wire >> 3)
|
|
207
199
|
wireType := int(wire & 0x7)
|
|
@@ -217,19 +209,9 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
217
209
|
return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType)
|
|
218
210
|
}
|
|
219
211
|
var stringLen uint64
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
if iNdEx >= l {
|
|
225
|
-
return io.ErrUnexpectedEOF
|
|
226
|
-
}
|
|
227
|
-
b := dAtA[iNdEx]
|
|
228
|
-
iNdEx++
|
|
229
|
-
stringLen |= uint64(b&0x7F) << shift
|
|
230
|
-
if b < 0x80 {
|
|
231
|
-
break
|
|
232
|
-
}
|
|
212
|
+
stringLen, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx)
|
|
213
|
+
if err != nil {
|
|
214
|
+
return err
|
|
233
215
|
}
|
|
234
216
|
intStringLen := int(stringLen)
|
|
235
217
|
if intStringLen < 0 {
|