Protocol Buffer Types: Difference between revisions
Jump to navigation
Jump to search
(→int32) |
(→Bytes) |
||
Line 34: | Line 34: | ||
<syntaxhighlight lang='protobuf'> | <syntaxhighlight lang='protobuf'> | ||
bytes some_bytes = 1; | bytes some_bytes = 1; | ||
</syntaxhighlight> | |||
=List (Array)= | |||
<syntaxhighlight lang='protobuf'> | |||
repeated <some_other_type> <field_name> = <tag>; | |||
</syntaxhighlight> | |||
Example: | |||
<syntaxhighlight lang='protobuf'> | |||
repeated int32 sizes = 1; | |||
repeated string names = 1; | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 00:01, 7 May 2024
Internal
Overview
String
string some_string = 1;
The default value is empty string (""
). The field contains UTF-8 encoded or 7-bit ASCII text.
Boolean
bool some_bool = 1;
The default value is false
.
Scalar Number Types
int32
int32 some_int = 1;
uint32
sint32
fixed32
sfixed32
int64
uint64
sint64
fixed64
sfixed64
float
double
Bytes
bytes some_bytes = 1;
List (Array)
repeated <some_other_type> <field_name> = <tag>;
Example:
repeated int32 sizes = 1;
repeated string names = 1;