Files
sponge/docs/apis.html
2023-05-26 00:47:20 +08:00

1406 lines
35 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>Protocol Documentation</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>
<style>
body {
width: 60em;
margin: 1em auto;
color: #222;
font-family: "Ubuntu", sans-serif;
padding-bottom: 4em;
}
h1 {
font-weight: normal;
border-bottom: 1px solid #aaa;
padding-bottom: 0.5ex;
}
h2 {
border-bottom: 1px solid #aaa;
padding-bottom: 0.5ex;
margin: 1.5em 0;
}
h3 {
font-weight: normal;
border-bottom: 1px solid #aaa;
padding-bottom: 0.5ex;
}
a {
text-decoration: none;
color: #567e25;
}
table {
width: 100%;
font-size: 80%;
border-collapse: collapse;
}
thead {
font-weight: 700;
background-color: #dcdcdc;
}
tbody tr:nth-child(even) {
background-color: #fbfbfb;
}
td {
border: 1px solid #ccc;
padding: 0.5ex 2ex;
}
td p {
text-indent: 1em;
margin: 0;
}
td p:nth-child(1) {
text-indent: 0;
}
.field-table td:nth-child(1) {
width: 10em;
}
.field-table td:nth-child(2) {
width: 10em;
}
.field-table td:nth-child(3) {
width: 6em;
}
.field-table td:nth-child(4) {
width: auto;
}
.extension-table td:nth-child(1) {
width: 10em;
}
.extension-table td:nth-child(2) {
width: 10em;
}
.extension-table td:nth-child(3) {
width: 10em;
}
.extension-table td:nth-child(4) {
width: 5em;
}
.extension-table td:nth-child(5) {
width: auto;
}
.enum-table td:nth-child(1) {
width: 10em;
}
.enum-table td:nth-child(2) {
width: 10em;
}
.enum-table td:nth-child(3) {
width: auto;
}
.scalar-value-types-table tr {
height: 3em;
}
#toc-container ul {
list-style-type: none;
padding-left: 1em;
line-height: 180%;
margin: 0;
}
#toc > li > a {
font-weight: bold;
}
.file-heading {
width: 100%;
display: table;
border-bottom: 1px solid #aaa;
margin: 4em 0 1.5em 0;
}
.file-heading h2 {
border: none;
display: table-cell;
}
.file-heading a {
text-align: right;
display: table-cell;
}
.badge {
width: 1.6em;
height: 1.6em;
display: inline-block;
line-height: 1.6em;
text-align: center;
font-weight: bold;
font-size: 60%;
color: #89ba48;
background-color: #dff0c8;
margin: 0.5ex 1em 0.5ex -1em;
border: 1px solid #fbfbfb;
border-radius: 1ex;
}
</style>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
</head>
<body>
<h1 id="title">Protocol Documentation</h1>
<h2>Table of Contents</h2>
<div id="toc-container">
<ul id="toc">
<li>
<a href="#api%2fserverNameExample%2fv1%2fuserExample.proto">api/serverNameExample/v1/userExample.proto</a>
<ul>
<li>
<a href="#api.serverNameExample.v1.CreateUserExampleReply"><span class="badge">M</span>CreateUserExampleReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.CreateUserExampleRequest"><span class="badge">M</span>CreateUserExampleRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.DeleteUserExampleByIDReply"><span class="badge">M</span>DeleteUserExampleByIDReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.DeleteUserExampleByIDRequest"><span class="badge">M</span>DeleteUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.GetUserExampleByIDReply"><span class="badge">M</span>GetUserExampleByIDReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.GetUserExampleByIDRequest"><span class="badge">M</span>GetUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.ListUserExampleByIDsReply"><span class="badge">M</span>ListUserExampleByIDsReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.ListUserExampleByIDsRequest"><span class="badge">M</span>ListUserExampleByIDsRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.ListUserExampleReply"><span class="badge">M</span>ListUserExampleReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.ListUserExampleRequest"><span class="badge">M</span>ListUserExampleRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.UpdateUserExampleByIDReply"><span class="badge">M</span>UpdateUserExampleByIDReply</a>
</li>
<li>
<a href="#api.serverNameExample.v1.UpdateUserExampleByIDRequest"><span class="badge">M</span>UpdateUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.serverNameExample.v1.UserExample"><span class="badge">M</span>UserExample</a>
</li>
<li>
<a href="#api.serverNameExample.v1.GenderType"><span class="badge">E</span>GenderType</a>
</li>
<li>
<a href="#api.serverNameExample.v1.userExampleService"><span class="badge">S</span>userExampleService</a>
</li>
</ul>
</li>
<li>
<a href="#api%2ftypes%2ftypes.proto">api/types/types.proto</a>
<ul>
<li>
<a href="#types.Column"><span class="badge">M</span>Column</a>
</li>
<li>
<a href="#types.Params"><span class="badge">M</span>Params</a>
</li>
</ul>
</li>
<li><a href="#scalar-value-types">Scalar Value Types</a></li>
</ul>
</div>
<div class="file-heading">
<h2 id="api/serverNameExample/v1/userExample.proto">api/serverNameExample/v1/userExample.proto</h2><a href="#title">Top</a>
</div>
<p></p>
<h3 id="api.serverNameExample.v1.CreateUserExampleReply">CreateUserExampleReply</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>name </p></td>
</tr>
<tr>
<td>email</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>email </p></td>
</tr>
<tr>
<td>password</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>password </p></td>
</tr>
<tr>
<td>phone</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>phone number </p></td>
</tr>
<tr>
<td>avatar</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>avatar </p></td>
</tr>
<tr>
<td>age</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>age </p></td>
</tr>
<tr>
<td>gender</td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>gender, 1:Male, 2:Female, other values:unknown </p></td>
</tr>
</tbody>
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>
<ul>
<li>string.min_len: 2</li>
</ul>
</td>
</tr>
<tr>
<td>email</td>
<td>
<ul>
<li>string.email: true</li>
</ul>
</td>
</tr>
<tr>
<td>password</td>
<td>
<ul>
<li>string.min_len: 10</li>
</ul>
</td>
</tr>
<tr>
<td>phone</td>
<td>
<ul>
<li>string.pattern: ^1[3456789]\d{9}$</li>
</ul>
</td>
</tr>
<tr>
<td>avatar</td>
<td>
<ul>
<li>string.uri: true</li>
</ul>
</td>
</tr>
<tr>
<td>age</td>
<td>
<ul>
<li>int32.lte: 120</li>
<li>int32.gte: 0</li>
</ul>
</td>
</tr>
<tr>
<td>gender</td>
<td>
<ul>
<li>enum.defined_only: true</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</h3>
<p></p>
<h3 id="api.serverNameExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
<ul>
<li>uint64.gte: 1</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>userExample</td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td></td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
<ul>
<li>uint64.gte: 1</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>userExamples</td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>ids</td>
<td><a href="#uint64">uint64</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.ListUserExampleReply">ListUserExampleReply</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>total</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
<td>userExamples</td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.ListUserExampleRequest">ListUserExampleRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>params</td>
<td><a href="#types.Params">types.Params</a></td>
<td></td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>params</td>
<td>
<ul>
<li>message.required: true</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</h3>
<p></p>
<h3 id="api.serverNameExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>name </p></td>
</tr>
<tr>
<td>email</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>email </p></td>
</tr>
<tr>
<td>password</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>password </p></td>
</tr>
<tr>
<td>phone</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>phone number </p></td>
</tr>
<tr>
<td>avatar</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>avatar </p></td>
</tr>
<tr>
<td>age</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>age </p></td>
</tr>
<tr>
<td>gender</td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>gender, 1:Male, 2:Female, other values:unknown </p></td>
</tr>
<tr>
<td>status</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>account status </p></td>
</tr>
<tr>
<td>login_at</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p>login timestamp </p></td>
</tr>
</tbody>
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
<ul>
<li>uint64.gte: 1</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.UserExample">UserExample</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>name </p></td>
</tr>
<tr>
<td>email</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>email </p></td>
</tr>
<tr>
<td>phone</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>phone number </p></td>
</tr>
<tr>
<td>avatar</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>avatar </p></td>
</tr>
<tr>
<td>age</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>age </p></td>
</tr>
<tr>
<td>gender</td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>gender, 1:Male, 2:Female, other values:unknown </p></td>
</tr>
<tr>
<td>status</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>account status </p></td>
</tr>
<tr>
<td>login_at</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p>login timestamp </p></td>
</tr>
<tr>
<td>created_at</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p>creation time </p></td>
</tr>
<tr>
<td>updated_at</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p>update time </p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.GenderType">GenderType</h3>
<p></p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>UNKNOWN</td>
<td>0</td>
<td><p></p></td>
</tr>
<tr>
<td>MALE</td>
<td>1</td>
<td><p></p></td>
</tr>
<tr>
<td>FEMALE</td>
<td>2</td>
<td><p></p></td>
</tr>
</tbody>
</table>
<h3 id="api.serverNameExample.v1.userExampleService">userExampleService</h3>
<p></p>
<table class="enum-table">
<thead>
<tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>Create</td>
<td><a href="#api.serverNameExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</a></td>
<td><a href="#api.serverNameExample.v1.CreateUserExampleReply">CreateUserExampleReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>DeleteByID</td>
<td><a href="#api.serverNameExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>UpdateByID</td>
<td><a href="#api.serverNameExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>GetByID</td>
<td><a href="#api.serverNameExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>ListByIDs</td>
<td><a href="#api.serverNameExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>List</td>
<td><a href="#api.serverNameExample.v1.ListUserExampleRequest">ListUserExampleRequest</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleReply">ListUserExampleReply</a></td>
<td><p></p></td>
</tr>
</tbody>
</table>
<h4>Methods with HTTP bindings</h4>
<table>
<thead>
<tr>
<td>Method Name</td>
<td>Method</td>
<td>Pattern</td>
<td>Body</td>
</tr>
</thead>
<tbody>
<tr>
<td>Create</td>
<td>POST</td>
<td>/api/v1/userExample</td>
<td>*</td>
</tr>
<tr>
<td>DeleteByID</td>
<td>DELETE</td>
<td>/api/v1/userExample/{id}</td>
<td></td>
</tr>
<tr>
<td>UpdateByID</td>
<td>PUT</td>
<td>/api/v1/userExample/{id}</td>
<td>*</td>
</tr>
<tr>
<td>GetByID</td>
<td>GET</td>
<td>/api/v1/userExample/{id}</td>
<td></td>
</tr>
<tr>
<td>ListByIDs</td>
<td>POST</td>
<td>/api/v1/userExample/list/ids</td>
<td>*</td>
</tr>
<tr>
<td>List</td>
<td>POST</td>
<td>/api/v1/userExample/list</td>
<td>*</td>
</tr>
</tbody>
</table>
<div class="file-heading">
<h2 id="api/types/types.proto">api/types/types.proto</h2><a href="#title">Top</a>
</div>
<p></p>
<h3 id="types.Column">Column</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>column name </p></td>
</tr>
<tr>
<td>exp</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>expressions, which default to = when the value is null, have =, ! =, &gt;, &gt;=, &lt;, &lt;=, like </p></td>
</tr>
<tr>
<td>value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>column value </p></td>
</tr>
<tr>
<td>logic</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>logical type, defaults to and when value is null, only &amp;(and), ||(or) </p></td>
</tr>
</tbody>
</table>
<h3 id="types.Params">Params</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>page number, starting from 0 </p></td>
</tr>
<tr>
<td>limit</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>lines per page </p></td>
</tr>
<tr>
<td>sort</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>sorted fields, multi-column sorting separated by commas </p></td>
</tr>
<tr>
<td>columns</td>
<td><a href="#types.Column">Column</a></td>
<td>repeated</td>
<td><p>query conditions </p></td>
</tr>
</tbody>
</table>
<h2 id="scalar-value-types">Scalar Value Types</h2>
<table class="scalar-value-types-table">
<thead>
<tr><td>.proto Type</td><td>Notes</td><td>C++</td><td>Java</td><td>Python</td><td>Go</td><td>C#</td><td>PHP</td><td>Ruby</td></tr>
</thead>
<tbody>
<tr id="double">
<td>double</td>
<td></td>
<td>double</td>
<td>double</td>
<td>float</td>
<td>float64</td>
<td>double</td>
<td>float</td>
<td>Float</td>
</tr>
<tr id="float">
<td>float</td>
<td></td>
<td>float</td>
<td>float</td>
<td>float</td>
<td>float32</td>
<td>float</td>
<td>float</td>
<td>Float</td>
</tr>
<tr id="int32">
<td>int32</td>
<td>Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead.</td>
<td>int32</td>
<td>int</td>
<td>int</td>
<td>int32</td>
<td>int</td>
<td>integer</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="int64">
<td>int64</td>
<td>Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead.</td>
<td>int64</td>
<td>long</td>
<td>int/long</td>
<td>int64</td>
<td>long</td>
<td>integer/string</td>
<td>Bignum</td>
</tr>
<tr id="uint32">
<td>uint32</td>
<td>Uses variable-length encoding.</td>
<td>uint32</td>
<td>int</td>
<td>int/long</td>
<td>uint32</td>
<td>uint</td>
<td>integer</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="uint64">
<td>uint64</td>
<td>Uses variable-length encoding.</td>
<td>uint64</td>
<td>long</td>
<td>int/long</td>
<td>uint64</td>
<td>ulong</td>
<td>integer/string</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="sint32">
<td>sint32</td>
<td>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.</td>
<td>int32</td>
<td>int</td>
<td>int</td>
<td>int32</td>
<td>int</td>
<td>integer</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="sint64">
<td>sint64</td>
<td>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.</td>
<td>int64</td>
<td>long</td>
<td>int/long</td>
<td>int64</td>
<td>long</td>
<td>integer/string</td>
<td>Bignum</td>
</tr>
<tr id="fixed32">
<td>fixed32</td>
<td>Always four bytes. More efficient than uint32 if values are often greater than 2^28.</td>
<td>uint32</td>
<td>int</td>
<td>int</td>
<td>uint32</td>
<td>uint</td>
<td>integer</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="fixed64">
<td>fixed64</td>
<td>Always eight bytes. More efficient than uint64 if values are often greater than 2^56.</td>
<td>uint64</td>
<td>long</td>
<td>int/long</td>
<td>uint64</td>
<td>ulong</td>
<td>integer/string</td>
<td>Bignum</td>
</tr>
<tr id="sfixed32">
<td>sfixed32</td>
<td>Always four bytes.</td>
<td>int32</td>
<td>int</td>
<td>int</td>
<td>int32</td>
<td>int</td>
<td>integer</td>
<td>Bignum or Fixnum (as required)</td>
</tr>
<tr id="sfixed64">
<td>sfixed64</td>
<td>Always eight bytes.</td>
<td>int64</td>
<td>long</td>
<td>int/long</td>
<td>int64</td>
<td>long</td>
<td>integer/string</td>
<td>Bignum</td>
</tr>
<tr id="bool">
<td>bool</td>
<td></td>
<td>bool</td>
<td>boolean</td>
<td>boolean</td>
<td>bool</td>
<td>bool</td>
<td>boolean</td>
<td>TrueClass/FalseClass</td>
</tr>
<tr id="string">
<td>string</td>
<td>A string must always contain UTF-8 encoded or 7-bit ASCII text.</td>
<td>string</td>
<td>String</td>
<td>str/unicode</td>
<td>string</td>
<td>string</td>
<td>string</td>
<td>String (UTF-8)</td>
</tr>
<tr id="bytes">
<td>bytes</td>
<td>May contain any arbitrary sequence of bytes.</td>
<td>string</td>
<td>ByteString</td>
<td>str</td>
<td>[]byte</td>
<td>ByteString</td>
<td>string</td>
<td>String (ASCII-8BIT)</td>
</tr>
</tbody>
</table>
</body>
</html>