forked from pseudomuto/protoc-gen-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.docbook
685 lines (677 loc) · 24.1 KB
/
example.docbook
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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.0//EN"
"http://www.oasis-open.org/docbook/xml/simple/1.0/sdocbook.dtd">
<article>
<title>Protocol Documentation</title>
<section>
<title>Booking.proto</title>
<para>Booking related messages.</para><para>This file is really just an example. The data model is completely
fictional.</para><para>Author: Elvis Stansvik</para>
<section id="com.example.Booking">
<title>Booking</title>
<para>Represents the booking of a vehicle.</para><para>Vehicles are some cool shit. But drive carefully!</para>
<table frame="all">
<title><classname>Booking</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>vehicle_id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>ID of booked vehicle.</para></entry>
</row>
<row>
<entry>customer_id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>Customer that booked the vehicle.</para></entry>
</row>
<row>
<entry>status</entry>
<entry><link linkend="com.example.BookingStatus">BookingStatus</link></entry>
<entry>required</entry>
<entry><para>Status of the booking.</para></entry>
</row>
<row>
<entry>confirmation_sent</entry>
<entry><link linkend="bool">bool</link></entry>
<entry>required</entry>
<entry><para>Has booking confirmation been sent?</para></entry>
</row>
<row>
<entry>payment_received</entry>
<entry><link linkend="bool">bool</link></entry>
<entry>required</entry>
<entry><para>Has payment been received?</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.BookingStatus">
<title>BookingStatus</title>
<para>Represents the status of a vehicle booking.</para>
<table frame="all">
<title><classname>BookingStatus</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>Unique booking status ID.</para></entry>
</row>
<row>
<entry>description</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Booking status description. E.g. "Active".</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.BookingService">
<title>BookingService</title>
<para>Service for handling vehicle bookings.</para>
<table frame="all">
<title><classname>BookingService</classname> Methods</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Method Name</entry>
<entry>Request Type</entry>
<entry>Response Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>BookVehicle</entry>
<entry><link linkend="com.example.Booking">Booking</link></entry>
<entry><link linkend="com.example.BookingStatus">BookingStatus</link></entry>
<entry><para>Used to book a vehicle. Pass in a Booking and a BookingStatus will be returned.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section>
<title>Customer.proto</title>
<para>This file has messages for describing a customer.</para><para>Author: Elvis Stansvik</para>
<section id="com.example.Address">
<title>Address</title>
<para>Represents a mail address.</para>
<table frame="all">
<title><classname>Address</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>address_line_1</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>First address line.</para></entry>
</row>
<row>
<entry>address_line_2</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Second address line.</para></entry>
</row>
<row>
<entry>address_line_3</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Second address line.</para></entry>
</row>
<row>
<entry>town</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Address town.</para></entry>
</row>
<row>
<entry>county</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Address county, if applicable.</para></entry>
</row>
<row>
<entry>country</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Address country.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.Customer">
<title>Customer</title>
<para>Represents a customer.</para>
<table frame="all">
<title><classname>Customer</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>Unique customer ID.</para></entry>
</row>
<row>
<entry>first_name</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Customer first name.</para></entry>
</row>
<row>
<entry>last_name</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Customer last name.</para></entry>
</row>
<row>
<entry>details</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Customer details.</para></entry>
</row>
<row>
<entry>email_address</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Customer e-mail address.</para></entry>
</row>
<row>
<entry>phone_number</entry>
<entry><link linkend="string">string</link></entry>
<entry>repeated</entry>
<entry><para>Customer phone numbers, primary first.</para></entry>
</row>
<row>
<entry>mail_addresses</entry>
<entry><link linkend="com.example.Address">Address</link></entry>
<entry>repeated</entry>
<entry><para>Customer mail addresses, primary first.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section>
<title>Vehicle.proto</title>
<para>Messages describing manufacturers / vehicles.</para>
<section id="com.example.Manufacturer">
<title>Manufacturer</title>
<para>Represents a manufacturer of cars.</para>
<table frame="all">
<title><classname>Manufacturer</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>The unique manufacturer ID.</para></entry>
</row>
<row>
<entry>code</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>A manufacturer code, e.g. "DKL4P".</para></entry>
</row>
<row>
<entry>details</entry>
<entry><link linkend="string">string</link></entry>
<entry>optional</entry>
<entry><para>Manufacturer details (minimum orders et.c.).</para></entry>
</row>
<row>
<entry>category</entry>
<entry><link linkend="com.example.Manufacturer.Category">Manufacturer.Category</link></entry>
<entry>optional</entry>
<entry><para>Manufacturer category. Default: CATEGORY_EXTERNAL</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.Model">
<title>Model</title>
<para>Represents a vehicle model.</para>
<table frame="all">
<title><classname>Model</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>id</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>The unique model ID.</para></entry>
</row>
<row>
<entry>model_code</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>The car model code, e.g. "PZ003".</para></entry>
</row>
<row>
<entry>model_name</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>The car model name, e.g. "Z3".</para></entry>
</row>
<row>
<entry>daily_hire_rate_dollars</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>required</entry>
<entry><para>Dollars per day.</para></entry>
</row>
<row>
<entry>daily_hire_rate_cents</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>required</entry>
<entry><para>Cents per day.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.Vehicle">
<title>Vehicle</title>
<para>Represents a vehicle that can be hired.</para>
<table frame="all">
<title><classname>Vehicle</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry>required</entry>
<entry><para>Unique vehicle ID.</para></entry>
</row>
<row>
<entry>model</entry>
<entry><link linkend="com.example.Model">Model</link></entry>
<entry>required</entry>
<entry><para>Vehicle model.</para></entry>
</row>
<row>
<entry>reg_number</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Vehicle registration number.</para></entry>
</row>
<row>
<entry>mileage</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>optional</entry>
<entry><para>Current vehicle mileage, if known.</para></entry>
</row>
<row>
<entry>category</entry>
<entry><link linkend="com.example.Vehicle.Category">Vehicle.Category</link></entry>
<entry>optional</entry>
<entry><para>Vehicle category.</para></entry>
</row>
<row>
<entry>daily_hire_rate_dollars</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>optional</entry>
<entry><para>Dollars per day. Default: 50</para></entry>
</row>
<row>
<entry>daily_hire_rate_cents</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>optional</entry>
<entry><para>Cents per day.</para></entry>
</row>
</tbody>
</tgroup>
</table>
<table frame="all">
<title><classname>Vehicle</classname> Nested Extensions</title>
<tgroup cols="5">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Extension</entry>
<entry>Type</entry>
<entry>Base</entry>
<entry>Number</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>series</entry>
<entry><link linkend="string">string</link></entry>
<entry><link linkend="com.example.Model">Model</link></entry>
<entry>100</entry>
<entry><para>Vehicle model series.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.Vehicle.Category">
<title>Vehicle.Category</title>
<para>Represents a vehicle category. E.g. "Sedan" or "Truck".</para>
<table frame="all">
<title><classname>Vehicle.Category</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>code</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Category code. E.g. "S".</para></entry>
</row>
<row>
<entry>description</entry>
<entry><link linkend="string">string</link></entry>
<entry>required</entry>
<entry><para>Category name. E.g. "Sedan".</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="com.example.Manufacturer.Category">
<title>Manufacturer.Category</title>
<para>Manufacturer category. A manufacturer may be either inhouse or external.</para>
<table frame="all">
<title><classname>Manufacturer.Category</classname> Values</title>
<tgroup cols="3">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Name</entry>
<entry>Number</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>CATEGORY_INHOUSE</entry>
<entry>0</entry>
<entry><para>The manufacturer is inhouse.</para></entry>
</row>
<row>
<entry>CATEGORY_EXTERNAL</entry>
<entry>1</entry>
<entry><para>The manufacturer is external.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>File-level Extensions</title>
<informaltable frame="all">
<tgroup cols="5">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Extension</entry>
<entry>Type</entry>
<entry>Base</entry>
<entry>Number</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>country</entry>
<entry><link linkend="string">string</link></entry>
<entry><link linkend="com.example.Manufacturer">Manufacturer</link></entry>
<entry>100</entry>
<entry><para>Manufacturer country. Default: "China"</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section>
<title>Scalar Value Types</title>
<informaltable frame="all">
<tgroup cols="5">
<colspec colwidth="*"/>
<colspec colwidth="5*"/>
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<thead>
<row>
<entry>.proto Type</entry>
<entry>Notes</entry>
<entry>C++ Type</entry>
<entry>Java Type</entry>
<entry>Python Type</entry>
</row>
</thead>
<tbody>
<row>
<entry id="double">double</entry>
<entry></entry>
<entry>double</entry>
<entry>double</entry>
<entry>float</entry>
</row>
<row>
<entry id="float">float</entry>
<entry></entry>
<entry>float</entry>
<entry>float</entry>
<entry>float</entry>
</row>
<row>
<entry id="int32">int32</entry>
<entry>Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.</entry>
<entry>int32</entry>
<entry>int</entry>
<entry>int</entry>
</row>
<row>
<entry id="int64">int64</entry>
<entry>Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.</entry>
<entry>int64</entry>
<entry>long</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="uint32">uint32</entry>
<entry>Uses variable-length encoding.</entry>
<entry>uint32</entry>
<entry>int</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="uint64">uint64</entry>
<entry>Uses variable-length encoding.</entry>
<entry>uint64</entry>
<entry>long</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="sint32">sint32</entry>
<entry>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.</entry>
<entry>int32</entry>
<entry>int</entry>
<entry>int</entry>
</row>
<row>
<entry id="sint64">sint64</entry>
<entry>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.</entry>
<entry>int64</entry>
<entry>long</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="fixed32">fixed32</entry>
<entry>Always four bytes. More efficient than uint32 if values are often greater than 2^28.</entry>
<entry>uint32</entry>
<entry>int</entry>
<entry>int</entry>
</row>
<row>
<entry id="fixed64">fixed64</entry>
<entry>Always eight bytes. More efficient than uint64 if values are often greater than 2^56.</entry>
<entry>uint64</entry>
<entry>long</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="sfixed32">sfixed32</entry>
<entry>Always four bytes.</entry>
<entry>int32</entry>
<entry>int</entry>
<entry>int</entry>
</row>
<row>
<entry id="sfixed64">sfixed64</entry>
<entry>Always eight bytes.</entry>
<entry>int64</entry>
<entry>long</entry>
<entry>int/long</entry>
</row>
<row>
<entry id="bool">bool</entry>
<entry></entry>
<entry>bool</entry>
<entry>boolean</entry>
<entry>boolean</entry>
</row>
<row>
<entry id="string">string</entry>
<entry>A string must always contain UTF-8 encoded or 7-bit ASCII text.</entry>
<entry>string</entry>
<entry>String</entry>
<entry>str/unicode</entry>
</row>
<row>
<entry id="bytes">bytes</entry>
<entry>May contain any arbitrary sequence of bytes.</entry>
<entry>string</entry>
<entry>ByteString</entry>
<entry>str</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</article>