mirror of
https://github.com/harness/drone.git
synced 2025-05-04 00:59:43 +08:00

Adds an EOF flag to data chunks to avoid using []byte("EOF") as end (due to potential false positives). Furthermore, a few cleanups are done: - Add TODOs for initial git changes - Add missing file headers - Fix typo for license (was licence) - Fix make wire target
69 lines
1.4 KiB
Protocol Buffer
69 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
package rpc;
|
|
|
|
option go_package = "github.com/harness/gitness/gitrpc/rpc";
|
|
|
|
import "shared.proto";
|
|
|
|
// RepositoryService is a service providing RPCs accessing repositories as a whole.
|
|
service RepositoryService {
|
|
rpc CreateRepository(stream CreateRepositoryRequest) returns (CreateRepositoryResponse);
|
|
rpc AddFilesAndPush(AddFilesAndPushRequest) returns (AddFilesAndPushResponse);
|
|
}
|
|
|
|
service UploadService {
|
|
rpc Upload(stream UploadFileRequest) returns (UploadFileResponse) {};
|
|
}
|
|
|
|
message CreateRepositoryRequest {
|
|
oneof data {
|
|
Repository repository = 1;
|
|
string filepath = 2;
|
|
Chunk chunk = 3;
|
|
}
|
|
}
|
|
|
|
message CreateRepositoryResponse {
|
|
string temp_path = 1;
|
|
}
|
|
|
|
message UploadFileRequest {
|
|
oneof data {
|
|
FileInfo info = 1;
|
|
Chunk chunk = 2;
|
|
};
|
|
}
|
|
|
|
message UploadFileResponse {
|
|
string id = 1;
|
|
uint32 size = 2;
|
|
}
|
|
|
|
message FileInfo {
|
|
string id = 1;
|
|
string username = 2;
|
|
string repo = 3;
|
|
string branch = 4;
|
|
string repo_path = 5;
|
|
string path = 6;
|
|
string file_type = 7;
|
|
}
|
|
|
|
message AddFilesAndPushRequest {
|
|
string repo_path = 1;
|
|
string message = 2;
|
|
repeated string files = 3;
|
|
}
|
|
|
|
message AddFilesAndPushResponse {}
|
|
|
|
message Repository {
|
|
string owner = 1;
|
|
string name = 2;
|
|
string default_branch = 3;
|
|
}
|
|
|
|
message Chunk {
|
|
bool eof = 1;
|
|
bytes data = 2;
|
|
} |