file

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_file_proto protoreflect.FileDescriptor

Functions

func NewFileEndpoints

func NewFileEndpoints() []*api.Endpoint

func RegisterFileHandler

func RegisterFileHandler(s server.Server, hdlr FileHandler, opts ...server.HandlerOption) error

Types

type BatchSaveRequest

type BatchSaveRequest struct {
	Files []*Record `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
	// contains filtered or unexported fields
}

Batch save multiple files in one call

func (*BatchSaveRequest) Descriptor deprecated

func (*BatchSaveRequest) Descriptor() ([]byte, []int)

Deprecated: Use BatchSaveRequest.ProtoReflect.Descriptor instead.

func (*BatchSaveRequest) GetFiles

func (x *BatchSaveRequest) GetFiles() []*Record

func (*BatchSaveRequest) ProtoMessage

func (*BatchSaveRequest) ProtoMessage()

func (*BatchSaveRequest) ProtoReflect

func (x *BatchSaveRequest) ProtoReflect() protoreflect.Message

func (*BatchSaveRequest) Reset

func (x *BatchSaveRequest) Reset()

func (*BatchSaveRequest) String

func (x *BatchSaveRequest) String() string

type BatchSaveResponse

type BatchSaveResponse struct {
	// contains filtered or unexported fields
}

func (*BatchSaveResponse) Descriptor deprecated

func (*BatchSaveResponse) Descriptor() ([]byte, []int)

Deprecated: Use BatchSaveResponse.ProtoReflect.Descriptor instead.

func (*BatchSaveResponse) ProtoMessage

func (*BatchSaveResponse) ProtoMessage()

func (*BatchSaveResponse) ProtoReflect

func (x *BatchSaveResponse) ProtoReflect() protoreflect.Message

func (*BatchSaveResponse) Reset

func (x *BatchSaveResponse) Reset()

func (*BatchSaveResponse) String

func (x *BatchSaveResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// The project name
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// Path to the file
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

Delete a file by project name/path

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetPath

func (x *DeleteRequest) GetPath() string

func (*DeleteRequest) GetProject

func (x *DeleteRequest) GetProject() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type FileService

type FileService interface {
	Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
	Save(ctx context.Context, in *SaveRequest, opts ...client.CallOption) (*SaveResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
}

func NewFileService

func NewFileService(name string, c client.Client) FileService

type ListRequest

type ListRequest struct {

	// Project, required for listing.
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// 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'
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

List file by their project and optionally a path.

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetPath

func (x *ListRequest) GetPath() string

func (*ListRequest) GetProject

func (x *ListRequest) GetProject() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Files []*Record `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetFiles

func (x *ListResponse) GetFiles() []*Record

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type ReadRequest

type ReadRequest struct {

	// Project name
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// Path to the file
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

Read a file by path

func (*ReadRequest) Descriptor deprecated

func (*ReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetPath

func (x *ReadRequest) GetPath() string

func (*ReadRequest) GetProject

func (x *ReadRequest) GetProject() string

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

func (x *ReadRequest) ProtoReflect() protoreflect.Message

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type ReadResponse

type ReadResponse struct {

	// Returns the file
	File *Record `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

func (*ReadResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetFile

func (x *ReadResponse) GetFile() *Record

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

func (x *ReadResponse) ProtoReflect() protoreflect.Message

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type Record

type Record struct {

	// A custom project to group files
	// eg. file-of-mywebsite.com
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// Path to file or folder eg. '/documents/text-files/file.txt'.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// File contents
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// Time the file was created e.g 2021-05-20T13:37:21Z
	Created string `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
	// Time the file was updated e.g 2021-05-20T13:37:21Z
	Updated string `protobuf:"bytes,5,opt,name=updated,proto3" json:"updated,omitempty"`
	// Any other associated metadata
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetContent

func (x *Record) GetContent() string

func (*Record) GetCreated

func (x *Record) GetCreated() string

func (*Record) GetMetadata

func (x *Record) GetMetadata() map[string]string

func (*Record) GetPath

func (x *Record) GetPath() string

func (*Record) GetProject

func (x *Record) GetProject() string

func (*Record) GetUpdated

func (x *Record) GetUpdated() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

type SaveRequest

type SaveRequest struct {
	File *Record `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

Save a file

func (*SaveRequest) Descriptor deprecated

func (*SaveRequest) Descriptor() ([]byte, []int)

Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.

func (*SaveRequest) GetFile

func (x *SaveRequest) GetFile() *Record

func (*SaveRequest) ProtoMessage

func (*SaveRequest) ProtoMessage()

func (*SaveRequest) ProtoReflect

func (x *SaveRequest) ProtoReflect() protoreflect.Message

func (*SaveRequest) Reset

func (x *SaveRequest) Reset()

func (*SaveRequest) String

func (x *SaveRequest) String() string

type SaveResponse

type SaveResponse struct {
	// contains filtered or unexported fields
}

func (*SaveResponse) Descriptor deprecated

func (*SaveResponse) Descriptor() ([]byte, []int)

Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.

func (*SaveResponse) ProtoMessage

func (*SaveResponse) ProtoMessage()

func (*SaveResponse) ProtoReflect

func (x *SaveResponse) ProtoReflect() protoreflect.Message

func (*SaveResponse) Reset

func (x *SaveResponse) Reset()

func (*SaveResponse) String

func (x *SaveResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL