schema.proto 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. syntax = "proto3";
  2. package schema_pb;
  3. option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb";
  4. ///////////////////////////
  5. // schema definition
  6. ///////////////////////////
  7. message RecordType {
  8. repeated Field fields = 1;
  9. }
  10. message Field {
  11. string name = 1;
  12. int32 field_index = 2;
  13. Type type = 3;
  14. bool is_repeated = 4;
  15. bool is_required = 5;
  16. }
  17. message Type {
  18. oneof kind {
  19. ScalarType scalar_type = 1;
  20. RecordType record_type = 2;
  21. ListType list_type = 3;
  22. }
  23. }
  24. enum ScalarType {
  25. BOOL = 0;
  26. INT32 = 1;
  27. INT64 = 3;
  28. FLOAT = 4;
  29. DOUBLE = 5;
  30. BYTES = 6;
  31. STRING = 7;
  32. }
  33. message ListType {
  34. Type element_type = 1;
  35. }
  36. ///////////////////////////
  37. // value definition
  38. ///////////////////////////
  39. message RecordValue {
  40. map<string, Value> fields = 1;
  41. }
  42. message Value {
  43. oneof kind {
  44. bool bool_value = 1;
  45. int32 int32_value = 2;
  46. int64 int64_value = 3;
  47. float float_value = 4;
  48. double double_value = 5;
  49. bytes bytes_value = 6;
  50. string string_value = 7;
  51. ListValue list_value = 14;
  52. RecordValue record_value = 15;
  53. }
  54. }
  55. message ListValue {
  56. repeated Value values = 1;
  57. }