mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 15:51:24 +00:00
Rename files service to file service (#115)
This commit is contained in:
51
file/proto/file.proto
Normal file
51
file/proto/file.proto
Normal file
@@ -0,0 +1,51 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package file;
|
||||
|
||||
option go_package = "./proto;file";
|
||||
|
||||
service File {
|
||||
rpc Save(SaveRequest) returns (SaveResponse) {}
|
||||
rpc List(ListRequest) returns (ListResponse) {}
|
||||
}
|
||||
|
||||
message Record {
|
||||
string id = 1;
|
||||
// A custom string for namespacing purposes
|
||||
// eg. file-of-mywebsite.com
|
||||
string project = 2;
|
||||
// Name of folder or file.
|
||||
string name = 3;
|
||||
// Path. Default is '/', ie. top level
|
||||
string path = 4;
|
||||
bool is_directory = 5;
|
||||
// File contents. Empty for directories.
|
||||
string file_contents = 6;
|
||||
int64 created = 7;
|
||||
int64 updated = 8;
|
||||
// owner
|
||||
string owner = 9;
|
||||
}
|
||||
|
||||
// The save endpoint lets you batch save text file.
|
||||
message SaveRequest {
|
||||
repeated Record files = 1;
|
||||
}
|
||||
|
||||
message SaveResponse {
|
||||
}
|
||||
|
||||
// List file by their project and optionally a path.
|
||||
message ListRequest {
|
||||
// Project, required for listing.
|
||||
string project = 1;
|
||||
// Defaults to '/', ie. lists all files in a project.
|
||||
// Supply path if of a folder if you want to list
|
||||
// files inside that folder
|
||||
// eg. '/docs'
|
||||
string path = 2;
|
||||
}
|
||||
|
||||
message ListResponse {
|
||||
repeated Record files = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user