file

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

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 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 to 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 files 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 as a map of key-value pairs
	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 {

	// The file to save
	File *Record `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
	// Make the file public: true or false
	Public bool `protobuf:"varint,2,opt,name=public,proto3" json:"public,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) GetPublic

func (x *SaveRequest) GetPublic() bool

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 {

	// The permalink for the file if made public
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveResponse) Descriptor deprecated

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

Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.

func (*SaveResponse) GetUrl

func (x *SaveResponse) GetUrl() string

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
JackTT - Gopher 🇻🇳