mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
migrate from model to store
This commit is contained in:
@@ -8,29 +8,34 @@ import (
|
|||||||
|
|
||||||
"github.com/micro/micro/v3/service/errors"
|
"github.com/micro/micro/v3/service/errors"
|
||||||
log "github.com/micro/micro/v3/service/logger"
|
log "github.com/micro/micro/v3/service/logger"
|
||||||
"github.com/micro/micro/v3/service/model"
|
"github.com/micro/micro/v3/service/store"
|
||||||
file "github.com/micro/services/file/proto"
|
file "github.com/micro/services/file/proto"
|
||||||
"github.com/micro/services/pkg/tenant"
|
"github.com/micro/services/pkg/tenant"
|
||||||
)
|
)
|
||||||
|
|
||||||
type File struct {
|
type File struct{}
|
||||||
db model.Model
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFile() *File {
|
func NewFile() *File {
|
||||||
i := model.ByEquality("project")
|
f := &File{}
|
||||||
i.Order.Type = model.OrderTypeUnordered
|
go f.Migrate()
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
db := model.New(
|
func (e *File) Migrate() {
|
||||||
file.Record{},
|
records, err := store.Read("file.Record:eqByProjectUnordByProject:", store.ReadPrefix())
|
||||||
&model.Options{
|
if err != nil {
|
||||||
Key: "Path",
|
log.Errorf("failed to migrate: %v", err)
|
||||||
Indexes: []model.Index{i},
|
return
|
||||||
},
|
}
|
||||||
)
|
|
||||||
|
|
||||||
return &File{
|
for _, rec := range records {
|
||||||
db: db,
|
parts := strings.Split(rec.Key, ":")
|
||||||
|
if len(parts) != 4 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
key := "file/" + parts[3]
|
||||||
|
log.Infof("Migrating %v to %v\n", rec.Key, key)
|
||||||
|
store.Write(&store.Record{Key: key, Value: rec.Value})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,32 +49,21 @@ func (e *File) Delete(ctx context.Context, req *file.DeleteRequest, rsp *file.De
|
|||||||
tenantId = "micro"
|
tenantId = "micro"
|
||||||
}
|
}
|
||||||
|
|
||||||
path := filepath.Join(tenantId, req.Project, req.Path)
|
path := filepath.Join("file", tenantId, req.Project, req.Path)
|
||||||
project := tenantId + "/" + req.Project
|
|
||||||
|
|
||||||
// delete one file
|
// delete one file
|
||||||
if !strings.HasSuffix(req.Path, "/") {
|
if !strings.HasSuffix(req.Path, "/") {
|
||||||
return e.db.Delete(model.QueryEquals("Path", path))
|
return store.Delete(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
var files []*file.Record
|
|
||||||
|
|
||||||
// read all the files for the project
|
// read all the files for the project
|
||||||
err := e.db.Read(model.QueryEquals("project", project), &files)
|
records, err := store.List(store.ListPrefix(path))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range records {
|
||||||
// delete a list of files
|
store.Delete(file)
|
||||||
if file.Project != project {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(file.Path, path) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// delete the file
|
|
||||||
e.db.Delete(model.QueryEquals("Path", file.Path))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -87,31 +81,30 @@ func (e *File) Read(ctx context.Context, req *file.ReadRequest, rsp *file.ReadRe
|
|||||||
tenantId = "micro"
|
tenantId = "micro"
|
||||||
}
|
}
|
||||||
|
|
||||||
var files []*file.Record
|
path := filepath.Join("file", tenantId, req.Project, req.Path)
|
||||||
|
|
||||||
project := tenantId + "/" + req.Project
|
var opts []store.ReadOption
|
||||||
|
|
||||||
// read all the files for the project
|
if strings.HasSuffix(req.Path, "/") {
|
||||||
err := e.db.Read(model.QueryEquals("project", project), &files)
|
opts = append(opts, store.ReadPrefix())
|
||||||
|
}
|
||||||
|
|
||||||
|
records, err := store.Read(path, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter the file
|
// filter the file
|
||||||
for _, file := range files {
|
for _, rec := range records {
|
||||||
// check project matches tenants
|
file := new(file.Record)
|
||||||
if file.Project != project {
|
|
||||||
|
if err := rec.Decode(file); err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// strip the tenant id
|
// strip the tenant id
|
||||||
file.Project = strings.TrimPrefix(file.Project, tenantId+"/")
|
file.Project = strings.TrimPrefix(file.Project, tenantId+"/")
|
||||||
file.Path = strings.TrimPrefix(file.Path, filepath.Join(tenantId, req.Project))
|
file.Path = strings.TrimPrefix(file.Path, filepath.Join(tenantId, req.Project))
|
||||||
|
|
||||||
// check the path matches the request
|
|
||||||
if req.Path == file.Path {
|
|
||||||
rsp.File = file
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -123,11 +116,13 @@ func (e *File) Save(ctx context.Context, req *file.SaveRequest, rsp *file.SaveRe
|
|||||||
tenantId = "micro"
|
tenantId = "micro"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.File == nil {
|
||||||
|
return errors.BadRequest("file.save", "missing file")
|
||||||
|
}
|
||||||
|
|
||||||
log.Info("Received File.Save request")
|
log.Info("Received File.Save request")
|
||||||
|
|
||||||
// prefix the tenant
|
path := filepath.Join("file", tenantId, req.File.Project, req.File.Path)
|
||||||
req.File.Project = filepath.Join(tenantId, req.File.Project)
|
|
||||||
req.File.Path = filepath.Join(req.File.Project, req.File.Path)
|
|
||||||
|
|
||||||
if len(req.File.Created) == 0 {
|
if len(req.File.Created) == 0 {
|
||||||
req.File.Created = time.Now().Format(time.RFC3339Nano)
|
req.File.Created = time.Now().Format(time.RFC3339Nano)
|
||||||
@@ -137,35 +132,7 @@ func (e *File) Save(ctx context.Context, req *file.SaveRequest, rsp *file.SaveRe
|
|||||||
req.File.Updated = time.Now().Format(time.RFC3339Nano)
|
req.File.Updated = time.Now().Format(time.RFC3339Nano)
|
||||||
|
|
||||||
// create the file
|
// create the file
|
||||||
err := e.db.Create(req.File)
|
return store.Write(store.NewRecord(path, req.File))
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *File) BatchSave(ctx context.Context, req *file.BatchSaveRequest, rsp *file.BatchSaveResponse) error {
|
|
||||||
tenantId, ok := tenant.FromContext(ctx)
|
|
||||||
if !ok {
|
|
||||||
tenantId = "micro"
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info("Received File.BatchSave request")
|
|
||||||
|
|
||||||
for _, reqFile := range req.Files {
|
|
||||||
// prefix the tenant
|
|
||||||
reqFile.Project = filepath.Join(tenantId, reqFile.Project)
|
|
||||||
reqFile.Path = filepath.Join(reqFile.Project, reqFile.Project)
|
|
||||||
|
|
||||||
// create the file
|
|
||||||
err := e.db.Create(reqFile)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *File) List(ctx context.Context, req *file.ListRequest, rsp *file.ListResponse) error {
|
func (e *File) List(ctx context.Context, req *file.ListRequest, rsp *file.ListResponse) error {
|
||||||
@@ -177,20 +144,17 @@ func (e *File) List(ctx context.Context, req *file.ListRequest, rsp *file.ListRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prefix tenant id
|
// prefix tenant id
|
||||||
project := tenantId + "/" + req.Project
|
path := filepath.Join("file", tenantId, req.Project, req.Path)
|
||||||
|
|
||||||
var files []*file.Record
|
records, err := store.Read(path, store.ReadPrefix())
|
||||||
|
if err != nil {
|
||||||
// read all the files for the project
|
|
||||||
if err := e.db.Read(model.QueryEquals("project", project), &files); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo funnily while this is the archetypical
|
for _, rec := range records {
|
||||||
// query for the KV store interface, it's not supported by the model
|
file := new(file.Record)
|
||||||
// so we do client side filtering here
|
|
||||||
for _, file := range files {
|
if err := rec.Decode(file); err != nil {
|
||||||
if file.Project != project {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,14 +166,7 @@ func (e *File) List(ctx context.Context, req *file.ListRequest, rsp *file.ListRe
|
|||||||
// no file listing ever contains it
|
// no file listing ever contains it
|
||||||
file.Content = ""
|
file.Content = ""
|
||||||
|
|
||||||
// if requesting all files or path matches
|
rsp.Files = append(rsp.Files, file)
|
||||||
if req.Path != "" {
|
|
||||||
if strings.HasPrefix(file.Path, req.Path) {
|
|
||||||
rsp.Files = append(rsp.Files, file)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rsp.Files = append(rsp.Files, file)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.27.1
|
||||||
// protoc v3.15.6
|
// protoc v3.15.6
|
||||||
// source: proto/file.proto
|
// source: proto/file.proto
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ type Record struct {
|
|||||||
Created string `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
|
Created string `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
|
||||||
// Time the file was updated e.g 2021-05-20T13:37:21Z
|
// Time the file was updated e.g 2021-05-20T13:37:21Z
|
||||||
Updated string `protobuf:"bytes,5,opt,name=updated,proto3" json:"updated,omitempty"`
|
Updated string `protobuf:"bytes,5,opt,name=updated,proto3" json:"updated,omitempty"`
|
||||||
// Any other associated metadata
|
// Any other associated metadata as a map of key-value pairs
|
||||||
Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,92 +114,6 @@ func (x *Record) GetMetadata() map[string]string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch save multiple files in one call
|
|
||||||
type BatchSaveRequest struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Files []*Record `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BatchSaveRequest) Reset() {
|
|
||||||
*x = BatchSaveRequest{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_file_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BatchSaveRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*BatchSaveRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *BatchSaveRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_file_proto_msgTypes[1]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use BatchSaveRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*BatchSaveRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BatchSaveRequest) GetFiles() []*Record {
|
|
||||||
if x != nil {
|
|
||||||
return x.Files
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type BatchSaveResponse struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BatchSaveResponse) Reset() {
|
|
||||||
*x = BatchSaveResponse{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_file_proto_msgTypes[2]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BatchSaveResponse) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*BatchSaveResponse) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *BatchSaveResponse) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_file_proto_msgTypes[2]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use BatchSaveResponse.ProtoReflect.Descriptor instead.
|
|
||||||
func (*BatchSaveResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{2}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read a file by path
|
// Read a file by path
|
||||||
type ReadRequest struct {
|
type ReadRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@@ -215,7 +129,7 @@ type ReadRequest struct {
|
|||||||
func (x *ReadRequest) Reset() {
|
func (x *ReadRequest) Reset() {
|
||||||
*x = ReadRequest{}
|
*x = ReadRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[3]
|
mi := &file_proto_file_proto_msgTypes[1]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -228,7 +142,7 @@ func (x *ReadRequest) String() string {
|
|||||||
func (*ReadRequest) ProtoMessage() {}
|
func (*ReadRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ReadRequest) ProtoReflect() protoreflect.Message {
|
func (x *ReadRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[3]
|
mi := &file_proto_file_proto_msgTypes[1]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -241,7 +155,7 @@ func (x *ReadRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ReadRequest) Descriptor() ([]byte, []int) {
|
func (*ReadRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{3}
|
return file_proto_file_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ReadRequest) GetProject() string {
|
func (x *ReadRequest) GetProject() string {
|
||||||
@@ -270,7 +184,7 @@ type ReadResponse struct {
|
|||||||
func (x *ReadResponse) Reset() {
|
func (x *ReadResponse) Reset() {
|
||||||
*x = ReadResponse{}
|
*x = ReadResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[4]
|
mi := &file_proto_file_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -283,7 +197,7 @@ func (x *ReadResponse) String() string {
|
|||||||
func (*ReadResponse) ProtoMessage() {}
|
func (*ReadResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ReadResponse) ProtoReflect() protoreflect.Message {
|
func (x *ReadResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[4]
|
mi := &file_proto_file_proto_msgTypes[2]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -296,7 +210,7 @@ func (x *ReadResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ReadResponse) Descriptor() ([]byte, []int) {
|
func (*ReadResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{4}
|
return file_proto_file_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ReadResponse) GetFile() *Record {
|
func (x *ReadResponse) GetFile() *Record {
|
||||||
@@ -318,7 +232,7 @@ type SaveRequest struct {
|
|||||||
func (x *SaveRequest) Reset() {
|
func (x *SaveRequest) Reset() {
|
||||||
*x = SaveRequest{}
|
*x = SaveRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[5]
|
mi := &file_proto_file_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -331,7 +245,7 @@ func (x *SaveRequest) String() string {
|
|||||||
func (*SaveRequest) ProtoMessage() {}
|
func (*SaveRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SaveRequest) ProtoReflect() protoreflect.Message {
|
func (x *SaveRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[5]
|
mi := &file_proto_file_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -344,7 +258,7 @@ func (x *SaveRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*SaveRequest) Descriptor() ([]byte, []int) {
|
func (*SaveRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{5}
|
return file_proto_file_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SaveRequest) GetFile() *Record {
|
func (x *SaveRequest) GetFile() *Record {
|
||||||
@@ -363,7 +277,7 @@ type SaveResponse struct {
|
|||||||
func (x *SaveResponse) Reset() {
|
func (x *SaveResponse) Reset() {
|
||||||
*x = SaveResponse{}
|
*x = SaveResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[6]
|
mi := &file_proto_file_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -376,7 +290,7 @@ func (x *SaveResponse) String() string {
|
|||||||
func (*SaveResponse) ProtoMessage() {}
|
func (*SaveResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SaveResponse) ProtoReflect() protoreflect.Message {
|
func (x *SaveResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[6]
|
mi := &file_proto_file_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -389,10 +303,10 @@ func (x *SaveResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*SaveResponse) Descriptor() ([]byte, []int) {
|
func (*SaveResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{6}
|
return file_proto_file_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List file by their project and optionally a path.
|
// List files by their project and optionally a path.
|
||||||
type ListRequest struct {
|
type ListRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -401,7 +315,7 @@ type ListRequest struct {
|
|||||||
// Project, required for listing.
|
// Project, required for listing.
|
||||||
Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
|
Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
|
||||||
// Defaults to '/', ie. lists all files in a project.
|
// Defaults to '/', ie. lists all files in a project.
|
||||||
// Supply path if of a folder if you want to list
|
// Supply path to a folder if you want to list
|
||||||
// files inside that folder
|
// files inside that folder
|
||||||
// eg. '/docs'
|
// eg. '/docs'
|
||||||
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
|
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
|
||||||
@@ -410,7 +324,7 @@ type ListRequest struct {
|
|||||||
func (x *ListRequest) Reset() {
|
func (x *ListRequest) Reset() {
|
||||||
*x = ListRequest{}
|
*x = ListRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[7]
|
mi := &file_proto_file_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -423,7 +337,7 @@ func (x *ListRequest) String() string {
|
|||||||
func (*ListRequest) ProtoMessage() {}
|
func (*ListRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListRequest) ProtoReflect() protoreflect.Message {
|
func (x *ListRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[7]
|
mi := &file_proto_file_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -436,7 +350,7 @@ func (x *ListRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ListRequest) Descriptor() ([]byte, []int) {
|
func (*ListRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{7}
|
return file_proto_file_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListRequest) GetProject() string {
|
func (x *ListRequest) GetProject() string {
|
||||||
@@ -464,7 +378,7 @@ type ListResponse struct {
|
|||||||
func (x *ListResponse) Reset() {
|
func (x *ListResponse) Reset() {
|
||||||
*x = ListResponse{}
|
*x = ListResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[8]
|
mi := &file_proto_file_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -477,7 +391,7 @@ func (x *ListResponse) String() string {
|
|||||||
func (*ListResponse) ProtoMessage() {}
|
func (*ListResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListResponse) ProtoReflect() protoreflect.Message {
|
func (x *ListResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[8]
|
mi := &file_proto_file_proto_msgTypes[6]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -490,7 +404,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ListResponse) Descriptor() ([]byte, []int) {
|
func (*ListResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{8}
|
return file_proto_file_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListResponse) GetFiles() []*Record {
|
func (x *ListResponse) GetFiles() []*Record {
|
||||||
@@ -515,7 +429,7 @@ type DeleteRequest struct {
|
|||||||
func (x *DeleteRequest) Reset() {
|
func (x *DeleteRequest) Reset() {
|
||||||
*x = DeleteRequest{}
|
*x = DeleteRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[9]
|
mi := &file_proto_file_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -528,7 +442,7 @@ func (x *DeleteRequest) String() string {
|
|||||||
func (*DeleteRequest) ProtoMessage() {}
|
func (*DeleteRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
|
func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[9]
|
mi := &file_proto_file_proto_msgTypes[7]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -541,7 +455,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{9}
|
return file_proto_file_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteRequest) GetProject() string {
|
func (x *DeleteRequest) GetProject() string {
|
||||||
@@ -567,7 +481,7 @@ type DeleteResponse struct {
|
|||||||
func (x *DeleteResponse) Reset() {
|
func (x *DeleteResponse) Reset() {
|
||||||
*x = DeleteResponse{}
|
*x = DeleteResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_file_proto_msgTypes[10]
|
mi := &file_proto_file_proto_msgTypes[8]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -580,7 +494,7 @@ func (x *DeleteResponse) String() string {
|
|||||||
func (*DeleteResponse) ProtoMessage() {}
|
func (*DeleteResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
|
func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_file_proto_msgTypes[10]
|
mi := &file_proto_file_proto_msgTypes[8]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -593,7 +507,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_file_proto_rawDescGZIP(), []int{10}
|
return file_proto_file_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
var File_proto_file_proto protoreflect.FileDescriptor
|
var File_proto_file_proto protoreflect.FileDescriptor
|
||||||
@@ -616,49 +530,45 @@ var file_proto_file_proto_rawDesc = []byte{
|
|||||||
0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
||||||
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||||
0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x61, 0x76,
|
0x3a, 0x02, 0x38, 0x01, 0x22, 0x3b, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65,
|
|
||||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52,
|
|
||||||
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x13, 0x0a, 0x11,
|
|
||||||
0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
||||||
0x65, 0x22, 0x3b, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
||||||
0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
|
|
||||||
0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x30,
|
|
||||||
0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20,
|
|
||||||
0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x66,
|
|
||||||
0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65,
|
|
||||||
0x22, 0x2f, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
|
||||||
0x20, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
|
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04, 0x66, 0x69, 0x6c,
|
|
||||||
0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
||||||
0x65, 0x22, 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
||||||
0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
|
|
||||||
0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x32,
|
|
||||||
0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22,
|
|
||||||
0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
|
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x66, 0x69, 0x6c,
|
|
||||||
0x65, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01,
|
0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
|
||||||
0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74,
|
0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74,
|
||||||
0x68, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x68, 0x22, 0x30, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x6e, 0x73, 0x65, 0x32, 0xd0, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x04,
|
0x65, 0x12, 0x20, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x52, 0x65, 0x61, 0x64, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64,
|
0x0c, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04, 0x66,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52,
|
0x69, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a,
|
0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x4c, 0x69, 0x73,
|
0x32, 0x0c, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04,
|
||||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e,
|
0x66, 0x69, 0x6c, 0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f,
|
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x0a, 0x04, 0x53, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x53, 0x61,
|
0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01,
|
||||||
0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x69, 0x6c, 0x65,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
|
||||||
0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74,
|
||||||
0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x66, 0x69, 0x6c, 0x65,
|
0x68, 0x22, 0x32, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
|
0x65, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,
|
0x32, 0x0c, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
|
||||||
0x6f, 0x3b, 0x66, 0x69, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
|
||||||
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
|
||||||
|
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||||
|
0x70, 0x61, 0x74, 0x68, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd0, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12,
|
||||||
|
0x2f, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52,
|
||||||
|
0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x69, 0x6c,
|
||||||
|
0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
|
0x12, 0x2f, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e,
|
||||||
|
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x69,
|
||||||
|
0x6c, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
|
0x00, 0x12, 0x2f, 0x0a, 0x04, 0x53, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x66, 0x69, 0x6c, 0x65,
|
||||||
|
0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66,
|
||||||
|
0x69, 0x6c, 0x65, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x66,
|
||||||
|
0x69, 0x6c, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x1a, 0x14, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x66, 0x69, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -673,40 +583,37 @@ func file_proto_file_proto_rawDescGZIP() []byte {
|
|||||||
return file_proto_file_proto_rawDescData
|
return file_proto_file_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_proto_file_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
var file_proto_file_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||||
var file_proto_file_proto_goTypes = []interface{}{
|
var file_proto_file_proto_goTypes = []interface{}{
|
||||||
(*Record)(nil), // 0: file.Record
|
(*Record)(nil), // 0: file.Record
|
||||||
(*BatchSaveRequest)(nil), // 1: file.BatchSaveRequest
|
(*ReadRequest)(nil), // 1: file.ReadRequest
|
||||||
(*BatchSaveResponse)(nil), // 2: file.BatchSaveResponse
|
(*ReadResponse)(nil), // 2: file.ReadResponse
|
||||||
(*ReadRequest)(nil), // 3: file.ReadRequest
|
(*SaveRequest)(nil), // 3: file.SaveRequest
|
||||||
(*ReadResponse)(nil), // 4: file.ReadResponse
|
(*SaveResponse)(nil), // 4: file.SaveResponse
|
||||||
(*SaveRequest)(nil), // 5: file.SaveRequest
|
(*ListRequest)(nil), // 5: file.ListRequest
|
||||||
(*SaveResponse)(nil), // 6: file.SaveResponse
|
(*ListResponse)(nil), // 6: file.ListResponse
|
||||||
(*ListRequest)(nil), // 7: file.ListRequest
|
(*DeleteRequest)(nil), // 7: file.DeleteRequest
|
||||||
(*ListResponse)(nil), // 8: file.ListResponse
|
(*DeleteResponse)(nil), // 8: file.DeleteResponse
|
||||||
(*DeleteRequest)(nil), // 9: file.DeleteRequest
|
nil, // 9: file.Record.MetadataEntry
|
||||||
(*DeleteResponse)(nil), // 10: file.DeleteResponse
|
|
||||||
nil, // 11: file.Record.MetadataEntry
|
|
||||||
}
|
}
|
||||||
var file_proto_file_proto_depIdxs = []int32{
|
var file_proto_file_proto_depIdxs = []int32{
|
||||||
11, // 0: file.Record.metadata:type_name -> file.Record.MetadataEntry
|
9, // 0: file.Record.metadata:type_name -> file.Record.MetadataEntry
|
||||||
0, // 1: file.BatchSaveRequest.files:type_name -> file.Record
|
0, // 1: file.ReadResponse.file:type_name -> file.Record
|
||||||
0, // 2: file.ReadResponse.file:type_name -> file.Record
|
0, // 2: file.SaveRequest.file:type_name -> file.Record
|
||||||
0, // 3: file.SaveRequest.file:type_name -> file.Record
|
0, // 3: file.ListResponse.files:type_name -> file.Record
|
||||||
0, // 4: file.ListResponse.files:type_name -> file.Record
|
1, // 4: file.File.Read:input_type -> file.ReadRequest
|
||||||
3, // 5: file.File.Read:input_type -> file.ReadRequest
|
5, // 5: file.File.List:input_type -> file.ListRequest
|
||||||
7, // 6: file.File.List:input_type -> file.ListRequest
|
3, // 6: file.File.Save:input_type -> file.SaveRequest
|
||||||
5, // 7: file.File.Save:input_type -> file.SaveRequest
|
7, // 7: file.File.Delete:input_type -> file.DeleteRequest
|
||||||
9, // 8: file.File.Delete:input_type -> file.DeleteRequest
|
2, // 8: file.File.Read:output_type -> file.ReadResponse
|
||||||
4, // 9: file.File.Read:output_type -> file.ReadResponse
|
6, // 9: file.File.List:output_type -> file.ListResponse
|
||||||
8, // 10: file.File.List:output_type -> file.ListResponse
|
4, // 10: file.File.Save:output_type -> file.SaveResponse
|
||||||
6, // 11: file.File.Save:output_type -> file.SaveResponse
|
8, // 11: file.File.Delete:output_type -> file.DeleteResponse
|
||||||
10, // 12: file.File.Delete:output_type -> file.DeleteResponse
|
8, // [8:12] is the sub-list for method output_type
|
||||||
9, // [9:13] is the sub-list for method output_type
|
4, // [4:8] is the sub-list for method input_type
|
||||||
5, // [5:9] is the sub-list for method input_type
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
5, // [5:5] is the sub-list for extension extendee
|
0, // [0:4] is the sub-list for field type_name
|
||||||
0, // [0:5] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_proto_file_proto_init() }
|
func init() { file_proto_file_proto_init() }
|
||||||
@@ -728,30 +635,6 @@ func file_proto_file_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*BatchSaveRequest); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_proto_file_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*BatchSaveResponse); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_proto_file_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*ReadRequest); i {
|
switch v := v.(*ReadRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -763,7 +646,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ReadResponse); i {
|
switch v := v.(*ReadResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -775,7 +658,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SaveRequest); i {
|
switch v := v.(*SaveRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -787,7 +670,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SaveResponse); i {
|
switch v := v.(*SaveResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -799,7 +682,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ListRequest); i {
|
switch v := v.(*ListRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -811,7 +694,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ListResponse); i {
|
switch v := v.(*ListResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -823,7 +706,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*DeleteRequest); i {
|
switch v := v.(*DeleteRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -835,7 +718,7 @@ func file_proto_file_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_file_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_file_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*DeleteResponse); i {
|
switch v := v.(*DeleteResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -854,7 +737,7 @@ func file_proto_file_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_proto_file_proto_rawDesc,
|
RawDescriptor: file_proto_file_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 12,
|
NumMessages: 10,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,14 +27,6 @@ message Record {
|
|||||||
map<string,string> metadata = 6;
|
map<string,string> metadata = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch save multiple files in one call
|
|
||||||
message BatchSaveRequest {
|
|
||||||
repeated Record files = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message BatchSaveResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read a file by path
|
// Read a file by path
|
||||||
message ReadRequest {
|
message ReadRequest {
|
||||||
// Project name
|
// Project name
|
||||||
|
|||||||
Reference in New Issue
Block a user