Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RootID is the id of the CouchDB document that represents the root on the // Cozy. RootID = "io.cozy.files.root-dir" // TrashID is the id of the CouchDB document that represents the trash on // the Cozy. TrashID = "io.cozy.files.trash-dir" // TrashName is the name of the trash folder on the Cozy. TrashName = ".cozy_trash" // Directory is the type of directories for the CouchDB documents on the // Cozy. Directory = "directory" // File is the type for, well, files for the CouchDB documents on the Cozy. File = "file" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangedDoc ¶
ChangedDoc is a result item from the changes feed.
type ChangesResponse ¶
type ChangesResponse struct { Docs []*ChangedDoc Seq Seq Pending int }
ChangesResponse describes the successful response to a call to the changes feed.
type Client ¶
type Client interface { // Changes is used to request the changes feed since a sequence number. Changes(seq *Seq, limit int, skipTrashed bool) (*ChangesResponse, error) // CreateDir will create a directory on the Cozy. CreateDir(parentID ID, name string) (*Doc, error) // Trash will put a file or directory inside the trash on the Cozy. Trash(doc *Doc) (*Doc, error) // EmptyTrash will delete the files and directories in the trash. Useful // for tests. EmptyTrash() error // Refresh can be used to refresh the OAuth access token. Refresh() error // Synchronized can be called to inform the Cozy that the client is now // synchronized. The data of last synchronization is shown in // cozy-settings. Synchronized() error }
Client is an interface for a client that can make requests to the cozy-stack to manipulate files.
type Docs ¶
type Docs struct { ByID map[ID]*Doc ByDirID map[ID]map[ID]*Doc // dirID -> map of children Seq *Seq FetchingChanges bool Refreshing bool RefreshedAt types.Clock SynchronizedAt types.Clock }
Docs is keeping the information about the files on the Cozy.
func (*Docs) MarkAsDeleted ¶
MarkAsDeleted is used to mark a document as deleted.
type ID ¶
type ID string
ID is used for identifying the CouchDB documents.
func (ID) IsDesignDoc ¶
IsDesignDoc returns true if the id is reserved for a design document.
Click to show internal directories.
Click to hide internal directories.