index

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_index_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FolderList

type FolderList struct {
	Path      string     `json:"path"`
	Directory bool       `json:"isDir,omitempty"`
	FileId    string     `json:"fileId,omitempty"`
	Date      *time.Time `json:"date,omitempty"`
	MimeType  string     `json:"mimeType,omitempty"`
}

FolderList contains the result of the ListFolder method

type Index

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

Index manages the index for all files and folders

var Instance *Index

Singleton

func (*Index) AddFile

func (i *Index) AddFile(path string, fileId []byte, mimeType string) error

AddFile adds a file to the index

func (*Index) DeleteFile

func (i *Index) DeleteFile(path string) ([]string, []string, error)

DeleteFile removes a file or folder from the index It returns the list of objects to remove as first argument, and their paths as second To remove a folder, make sure the path ends with /*

func (*Index) FileExists

func (i *Index) FileExists(path string) (bool, error)

FileExists returns true if the file exists in the index

func (*Index) ListFolder

func (i *Index) ListFolder(path string) ([]FolderList, error)

ListFolder returns the list of elements in a folder

func (*Index) Refresh

func (i *Index) Refresh(force bool) error

Refresh an index if necessary

func (*Index) SetStore

func (i *Index) SetStore(store fs.Fs)

SetStore sets the store (filesystem) object to use

type IndexElement

type IndexElement struct {
	Path     string               `protobuf:"bytes,1,opt,name=path,json=p,proto3" json:"path,omitempty"`
	FileId   []byte               `protobuf:"bytes,2,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	Date     *timestamp.Timestamp `protobuf:"bytes,3,opt,name=date,json=d,proto3" json:"date,omitempty"`
	MimeType string               `protobuf:"bytes,4,opt,name=mime_type,json=m,proto3" json:"mime_type,omitempty"`
	// This is added for compatibility with the version 1 JSON format
	//
	// Deprecated: Do not use.
	FileIdString string `protobuf:"bytes,102,opt,name=file_id_string,json=n,proto3" json:"file_id_string,omitempty"`
	// contains filtered or unexported fields
}

IndexElement message

func (*IndexElement) Descriptor deprecated added in v0.4.0

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

Deprecated: Use IndexElement.ProtoReflect.Descriptor instead.

func (*IndexElement) GetDate added in v0.4.0

func (x *IndexElement) GetDate() *timestamp.Timestamp

func (*IndexElement) GetFileId added in v0.4.0

func (x *IndexElement) GetFileId() []byte

func (*IndexElement) GetFileIdString deprecated added in v0.4.0

func (x *IndexElement) GetFileIdString() string

Deprecated: Do not use.

func (*IndexElement) GetMimeType added in v0.4.0

func (x *IndexElement) GetMimeType() string

func (*IndexElement) GetPath added in v0.4.0

func (x *IndexElement) GetPath() string

func (*IndexElement) ProtoMessage added in v0.4.0

func (*IndexElement) ProtoMessage()

func (*IndexElement) ProtoReflect added in v0.4.0

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

func (*IndexElement) Reset added in v0.4.0

func (x *IndexElement) Reset()

func (*IndexElement) String added in v0.4.0

func (x *IndexElement) String() string

type IndexFile

type IndexFile struct {
	Version  uint32          `protobuf:"varint,1,opt,name=version,json=v,proto3" json:"version,omitempty"`
	Elements []*IndexElement `protobuf:"bytes,2,rep,name=elements,json=e,proto3" json:"elements,omitempty"`
	// contains filtered or unexported fields
}

IndexFile message

func (*IndexFile) Descriptor deprecated added in v0.4.0

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

Deprecated: Use IndexFile.ProtoReflect.Descriptor instead.

func (*IndexFile) GetElements added in v0.4.0

func (x *IndexFile) GetElements() []*IndexElement

func (*IndexFile) GetVersion added in v0.4.0

func (x *IndexFile) GetVersion() uint32

func (*IndexFile) ProtoMessage added in v0.4.0

func (*IndexFile) ProtoMessage()

func (*IndexFile) ProtoReflect added in v0.4.0

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

func (*IndexFile) Reset added in v0.4.0

func (x *IndexFile) Reset()

func (*IndexFile) String added in v0.4.0

func (x *IndexFile) String() string

Jump to

Keyboard shortcuts

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