-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add Plugin V3 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2f5ec2c
feat: Add Plugin V3
yevgenypats 30cebbb
Rename CreateTable to MigrateTable
hermanschaaf c5faf20
Update plugin.proto
hermanschaaf 02b0af9
remove unused proto
yevgenypats 5055745
address review
yevgenypats 67e51e7
fix review
yevgenypats a081f5f
add comment
yevgenypats File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package cloudquery.discovery.v1; | ||
|
||
option go_package = "github.com/cloudquery/plugin-pb-go/pb/discovery/v1;discovery"; | ||
|
||
service Discovery { | ||
// Get the name of the plugin | ||
rpc GetVersions(GetVersions.Request) returns (GetVersions.Response); | ||
} | ||
|
||
message GetVersions { | ||
message Request {} | ||
message Response { | ||
repeated uint64 versions = 1; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 {} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
options
not be outside of the oneof?