Files fixes, remove id (#126)

This commit is contained in:
Janos Dobronszki
2021-05-26 13:03:23 +01:00
committed by GitHub
parent f6cc5af43f
commit 24ff482bab
3 changed files with 24 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.15.6
// protoc v3.6.1
// source: proto/file.proto
package file
@@ -25,16 +25,14 @@ type Record struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// id of the record
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// A custom project to group files
// eg. file-of-mywebsite.com
Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
// Name of folder or file.
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
// Path. Default is '/', ie. top level
// Path eg. '/documents/text-files'. Default is '/', ie. top level
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
// whether its a directory
// Is it a directory (true) or a file (false)
IsDirectory bool `protobuf:"varint,5,opt,name=is_directory,json=isDirectory,proto3" json:"is_directory,omitempty"`
// File contents. Empty for directories.
Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
@@ -80,13 +78,6 @@ func (*Record) Descriptor() ([]byte, []int) {
return file_proto_file_proto_rawDescGZIP(), []int{0}
}
func (x *Record) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Record) GetProject() string {
if x != nil {
return x.Project
@@ -549,9 +540,8 @@ var File_proto_file_proto protoreflect.FileDescriptor
var file_proto_file_proto_rawDesc = []byte{
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xd0, 0x02, 0x0a, 0x06, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02,
0x74, 0x6f, 0x12, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x06, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,

View File

@@ -12,26 +12,24 @@ service File {
}
message Record {
// id of the record
string id = 1;
// A custom project to group files
// eg. file-of-mywebsite.com
string project = 2;
// Name of folder or file.
string name = 3;
// Path. Default is '/', ie. top level
// Path eg. '/documents/text-files'. Default is '/', ie. top level
string path = 4;
// whether its a directory
// Is it a directory (true) or a file (false)
bool is_directory = 5;
// File contents. Empty for directories.
string data = 6;
// time the file was created
// Time the file was created, number of seconds since Unix epoch
int64 created = 7;
// time the file was updated
// Time the file was updated, number of seconds since Unix epoch
int64 updated = 8;
// owner of the file e.g alice
// Owner of the file e.g alice
string owner = 9;
// any other associated metadata
// Any other associated metadata
map<string,string> metadata = 10;
}
@@ -45,11 +43,11 @@ message BatchSaveResponse {
// Read a file by path
message ReadRequest {
// project name
// Project name
string project = 1;
// path to the file
// Path to the file
string path = 2;
// file name
// File name
string name = 3;
}