~bigbes/tarantool

tarantool-protobuf

ref: 2656c977e43bd649d9ac766cec637c6733706478 tarantool-protobuf/examples/proto/quickstart.proto -rw-r--r-- 513 bytes
2656c977 — Eugene Blikh bench,codec: pin proto2 paths, kill pairs() on extension hot path 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
syntax = "proto3";

package quickstart;

// One message, one enum. Enough to exercise the round-trip path.
//
// Generate with:
//   protoc --tarantool_out=. examples/proto/quickstart.proto
//
// Then in Tarantool:
//   local qs = require('quickstart.quickstart_pb')
//   local bytes = qs.User_encode({id = 7, name = 'Alice', role = qs.Role.ADMIN})

enum Role {
  ROLE_UNSPECIFIED = 0;
  USER = 1;
  ADMIN = 2;
}

message User {
  int32 id = 1;
  string name = 2;
  Role role = 3;
  repeated string emails = 4;
}