~bigbes/tarantool

tarantool-protobuf

ref: add2f224a35dd8b9ce38995cfe76f7715e78d3cd tarantool-protobuf/examples/expected/runtime/conformance/conformance_pb.lua -rw-r--r-- 5.1 KiB
add2f224 — Eugene Blikh wire: document why encode_varint's fast path stays 1-byte only 3 months ago
                                                                                
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
-- Code generated by protoc-gen-tarantool. DO NOT EDIT.
-- source: conformance.proto
-- syntax: proto3
-- package: conformance

local pb = require("pb")
local wire = pb.wire

local M = {}

-- Enum: conformance.WireFormat
M.WireFormat_descriptor = pb.enum("conformance.WireFormat", {
    UNSPECIFIED = 0,
    PROTOBUF = 1,
    JSON = 2,
    JSPB = 3,
    TEXT_FORMAT = 4,
})
M.WireFormat = M.WireFormat_descriptor.by_name

-- Enum: conformance.TestCategory
M.TestCategory_descriptor = pb.enum("conformance.TestCategory", {
    UNSPECIFIED_TEST = 0,
    BINARY_TEST = 1,
    JSON_TEST = 2,
    JSON_IGNORE_UNKNOWN_PARSING_TEST = 3,
    JSPB_TEST = 4,
    TEXT_FORMAT_TEST = 5,
})
M.TestCategory = M.TestCategory_descriptor.by_name

-- Pre-declare message descriptors so cross-references resolve.
M.TestStatus_descriptor = {name = "conformance.TestStatus"}
M.FailureSet_descriptor = {name = "conformance.FailureSet"}
M.ConformanceRequest_descriptor = {name = "conformance.ConformanceRequest"}
M.ConformanceResponse_descriptor = {name = "conformance.ConformanceResponse"}
M.JspbEncodingConfig_descriptor = {name = "conformance.JspbEncodingConfig"}

-- Message: conformance.TestStatus
M.TestStatus_descriptor.fields = {
    {name="name", id=1, kind='scalar', proto_type="string"},
    {name="failure_message", id=2, kind='scalar', proto_type="string"},
    {name="matched_name", id=3, kind='scalar', proto_type="string"},
}
pb.finalize_message(M.TestStatus_descriptor)

-- Message: conformance.FailureSet
M.FailureSet_descriptor.fields = {
    {name="test", id=2, kind='message', message=M.TestStatus_descriptor, repeated=true},
}
pb.finalize_message(M.FailureSet_descriptor)

-- Message: conformance.ConformanceRequest
M.ConformanceRequest_descriptor.fields = {
    {name="protobuf_payload", id=1, kind='scalar', proto_type="bytes", oneof="payload"},
    {name="json_payload", id=2, kind='scalar', proto_type="string", oneof="payload"},
    {name="jspb_payload", id=7, kind='scalar', proto_type="string", oneof="payload"},
    {name="text_payload", id=8, kind='scalar', proto_type="string", oneof="payload"},
    {name="requested_output_format", id=3, kind='enum', enum=M.WireFormat_descriptor},
    {name="message_type", id=4, kind='scalar', proto_type="string"},
    {name="test_category", id=5, kind='enum', enum=M.TestCategory_descriptor},
    {name="jspb_encoding_options", id=6, kind='message', message=M.JspbEncodingConfig_descriptor},
    {name="print_unknown_fields", id=9, kind='scalar', proto_type="bool"},
}
M.ConformanceRequest_descriptor.oneofs = {
    payload = {"protobuf_payload", "json_payload", "jspb_payload", "text_payload"},
}
pb.finalize_message(M.ConformanceRequest_descriptor)

-- Message: conformance.ConformanceResponse
M.ConformanceResponse_descriptor.fields = {
    {name="parse_error", id=1, kind='scalar', proto_type="string", oneof="result"},
    {name="serialize_error", id=6, kind='scalar', proto_type="string", oneof="result"},
    {name="timeout_error", id=9, kind='scalar', proto_type="string", oneof="result"},
    {name="runtime_error", id=2, kind='scalar', proto_type="string", oneof="result"},
    {name="protobuf_payload", id=3, kind='scalar', proto_type="bytes", oneof="result"},
    {name="json_payload", id=4, kind='scalar', proto_type="string", oneof="result"},
    {name="skipped", id=5, kind='scalar', proto_type="string", oneof="result"},
    {name="jspb_payload", id=7, kind='scalar', proto_type="string", oneof="result"},
    {name="text_payload", id=8, kind='scalar', proto_type="string", oneof="result"},
}
M.ConformanceResponse_descriptor.oneofs = {
    result = {"parse_error", "serialize_error", "timeout_error", "runtime_error", "protobuf_payload", "json_payload", "skipped", "jspb_payload", "text_payload"},
}
pb.finalize_message(M.ConformanceResponse_descriptor)

-- Message: conformance.JspbEncodingConfig
M.JspbEncodingConfig_descriptor.fields = {
    {name="use_jspb_array_any_format", id=1, kind='scalar', proto_type="bool"},
}
pb.finalize_message(M.JspbEncodingConfig_descriptor)

function M.TestStatus_new(t) return t or {} end
function M.TestStatus_encode(t) return pb.encode(M.TestStatus_descriptor, t) end
function M.TestStatus_decode(b) return pb.decode(M.TestStatus_descriptor, b) end

function M.FailureSet_new(t) return t or {} end
function M.FailureSet_encode(t) return pb.encode(M.FailureSet_descriptor, t) end
function M.FailureSet_decode(b) return pb.decode(M.FailureSet_descriptor, b) end

function M.ConformanceRequest_new(t) return t or {} end
function M.ConformanceRequest_encode(t) return pb.encode(M.ConformanceRequest_descriptor, t) end
function M.ConformanceRequest_decode(b) return pb.decode(M.ConformanceRequest_descriptor, b) end

function M.ConformanceResponse_new(t) return t or {} end
function M.ConformanceResponse_encode(t) return pb.encode(M.ConformanceResponse_descriptor, t) end
function M.ConformanceResponse_decode(b) return pb.decode(M.ConformanceResponse_descriptor, b) end

function M.JspbEncodingConfig_new(t) return t or {} end
function M.JspbEncodingConfig_encode(t) return pb.encode(M.JspbEncodingConfig_descriptor, t) end
function M.JspbEncodingConfig_decode(b) return pb.decode(M.JspbEncodingConfig_descriptor, b) end

return M