seaweedfs/weed/pb/schema.proto

67 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

2024-04-12 16:30:29 +08:00
syntax = "proto3";
package schema_pb;
option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb";
2024-04-13 13:27:16 +08:00
///////////////////////////
// schema definition
///////////////////////////
2024-04-12 16:30:29 +08:00
message RecordType {
2024-04-13 04:31:54 +08:00
repeated Field fields = 1;
2024-04-12 16:30:29 +08:00
}
message Field {
string name = 1;
2024-04-28 14:30:06 +08:00
int32 field_index = 2;
Type type = 3;
2024-04-13 04:29:35 +08:00
bool is_repeated = 4;
bool is_required = 5;
2024-04-12 16:30:29 +08:00
}
message Type {
oneof kind {
ScalarType scalar_type = 1;
RecordType record_type = 2;
2024-04-18 14:49:21 +08:00
ListType list_type = 3;
2024-04-12 16:30:29 +08:00
}
}
enum ScalarType {
BOOLEAN = 0;
INTEGER = 1;
LONG = 3;
FLOAT = 4;
DOUBLE = 5;
BYTES = 6;
STRING = 7;
}
2024-04-18 14:49:21 +08:00
message ListType {
Type element_type = 1;
}
2024-04-13 13:27:16 +08:00
///////////////////////////
// value definition
///////////////////////////
message RecordValue {
map<string, Value> fields = 1;
}
message Value {
oneof kind {
bool bool_value = 1;
int32 int32_value = 2;
int64 int64_value = 3;
float float_value = 4;
double double_value = 5;
bytes bytes_value = 6;
string string_value = 7;
2024-04-18 14:49:21 +08:00
ListValue list_value = 14;
2024-04-13 13:27:16 +08:00
RecordValue record_value = 15;
}
2024-04-12 16:30:29 +08:00
}
2024-04-18 14:49:21 +08:00
message ListValue {
repeated Value values = 1;
}