summaryrefslogtreecommitdiff
path: root/table.proto
blob: b06aac5a0e3b99a56691a3d51aae608cd4f5cea1 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
syntax = "proto3";

// playing around with ideas here

package gitpb;

import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
import "google/protobuf/any.proto"; // Import the well-known type for Timestamp
import "widget.proto"; // Import the well-known type for Timestamp

//
// this code was written this way to make it easy for me
// to originally implement and auto generate the needed code
// with autogenpb
//

// experiments in various options. think about this more.

message ColAttr {
        enum VarType {
                ANY = 0;
                INT = 1;
                STRING = 2;
                TIME = 3;
                DURATION = 4;
                BYTES = 5;
        }

        int32                          pad         = 1;
        int32                          width       = 2;
        bool                           click       = 3;
        VarType                        type        = 4;
}
message AnyCol {
        Widget                         header      = 1;
        repeated Widget                widgets     = 2;
        ColAttr                        attr        = 3;
        repeated google.protobuf.Any   vals        = 4;  // deprecate
}

message Table {                                          // `autogenpb:marshal`
        string                         uuid        = 1;
        string                         title       = 2;
        Widget                         parent      = 3;
        Widget                         grid        = 4;
        repeated AnyCol                anyCols     = 11;
        int64                          height      = 12; // the number of rows
}

message Tables {                                         // `autogenpb:marshal`
        string                         uuid        = 1;  // `autogenpb:uuid:c328aa62-3c4f-4d00-9244-cc44ae75ab1b`
        string                         version     = 2;  // `autogenpb:version:v1`
        repeated Table                 Tables      = 3;
}