Files service (#63)

* Files service

* Readme change

* Fix doc
This commit is contained in:
Janos Dobronszki
2021-02-04 16:31:04 +00:00
committed by GitHub
parent 460e7a103a
commit b850b61085
12 changed files with 794 additions and 0 deletions

48
files/proto/files.proto Normal file
View 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;
}