mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 07:41:25 +00:00
48
files/proto/files.proto
Normal file
48
files/proto/files.proto
Normal file
@@ -0,0 +1,48 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package files;
|
||||
|
||||
option go_package = "proto;files";
|
||||
|
||||
service Files {
|
||||
rpc Save(SaveRequest) returns (SaveResponse) {}
|
||||
rpc List(ListRequest) returns (ListResponse) {}
|
||||
}
|
||||
|
||||
message File {
|
||||
// A custom string for namespacing purposes
|
||||
// eg. files-of-mywebsite.com
|
||||
string project = 1;
|
||||
// Name of folder or file.
|
||||
string name = 2;
|
||||
// Path. Default is '/', ie. top level
|
||||
string path = 3;
|
||||
bool isDirectory = 4;
|
||||
// File contents. Empty for directories.
|
||||
string fileContents = 5;
|
||||
int64 created = 6;
|
||||
int64 updated = 7;
|
||||
}
|
||||
|
||||
// The save endpoint lets you batch save text files.
|
||||
message SaveRequest {
|
||||
repeated File files = 1;
|
||||
}
|
||||
|
||||
message SaveResponse {
|
||||
}
|
||||
|
||||
// List files 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
|
||||
// file inside that folder
|
||||
// eg. '/docs'
|
||||
string path = 2;
|
||||
}
|
||||
|
||||
message ListResponse {
|
||||
repeated File files = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user