Built-in types
Each field in a message schema has a type. This type can be another message schema, an enum, or one of the primitive types documented below:
boolean
Either true
or false
.
bytes
Raw binary data, represented as a Uint8Array
in JavaScript.
enum
Number that serves as a key in a set of named constants.
float64
64-bit floating-point number.
string
String value encoded as UTF-8.
time
field | type | required | description |
---|---|---|---|
sec | uint32 | ✓ | Seconds since epoch |
nsec | uint32 | ✓ | Additional nanoseconds since epoch |
duration
field | type | required | description |
---|---|---|---|
sec | int32 | ✓ | Seconds offset |
nsec | uint32 | ✓ | Nanoseconds offset in the positive direction |
uint32
Non-negative integer value between 0 and 232−1.
int32
Integer value between −231 and 231−1.