-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.proto
126 lines (110 loc) · 2.68 KB
/
plugin.proto
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
syntax = "proto3";
package cloudquery.plugin.v3;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/cloudquery/plugin-pb-go/pb/plugin/v3;plugin";
service Plugin {
// Get the name of the plugin
rpc GetName(GetName.Request) returns (GetName.Response);
// Get the current version of the plugin
rpc GetVersion(GetVersion.Request) returns (GetVersion.Response);
// Configure the plugin with the given credentials and mode
rpc Init(Init.Request) returns (Init.Response);
// Get all tables the source plugin supports. Must be called after Init
rpc GetTables(GetTables.Request) returns (GetTables.Response);
// Start the sync the source plugin
rpc Sync(Sync.Request) returns (stream Sync.Response);
// Write resources
rpc Write(stream Write.Request) returns (Write.Response);
// Send signal to flush and close open connections
rpc Close(Close.Request) returns (Close.Response);
}
enum Registry {
REGISTRY_UNSPECIFIED = 0;
REGISTRY_GITHUB = 1;
REGISTRY_GRPC = 2;
REGISTRY_LOCAL = 3;
}
message StateBackendSpec {
string name = 1;
string path = 2;
string version = 3;
Registry registry = 4;
bytes spec = 5;
}
message GetName {
message Request {}
message Response {
string name = 1;
}
}
message GetVersion {
message Request {}
message Response {
string version = 1;
}
}
message Init {
message Request {
// Internal plugin-specific spec
bytes spec = 1;
}
message Response {}
}
message GetTables {
message Request {
repeated string tables = 1;
repeated string skip_tables = 2;
}
message Response {
// marshalled []arrow.Schema
repeated bytes tables = 1;
}
}
message WriteOptions {
bool migrate_force = 1;
}
message MessageMigrateTable {
// marshalled arrow.Schema
bytes table = 1;
}
message MessageInsert {
// marshalled arrow.Record
bytes record = 1;
}
message MessageDeleteStale {
// marshalled arrow.Schema
bytes table = 1;
string source_name = 2;
google.protobuf.Timestamp sync_time = 3;
}
message Sync {
message Request {
repeated string tables = 1;
repeated string skip_tables = 2;
StateBackendSpec state_backend = 3;
}
message Response {
oneof message {
MessageMigrateTable migrate_table = 1;
MessageInsert insert = 2;
MessageDeleteStale delete = 3;
}
}
}
message Write {
message Request {
oneof message {
// WriteOptions is only used for the first message
// to configure the write stream
WriteOptions options = 1;
MessageMigrateTable migrate_table = 2;
MessageInsert insert = 3;
MessageDeleteStale delete = 4;
}
}
message Response {}
}
message Close {
message Request {}
message Response {}
}