Documentation ¶
Index ¶
- Constants
- func DocumentsFileTree(tree *HashTree) *filetree.FileTreeCtx
- func FileHashAndSize(file string) ([]byte, int64, error)
- func HashEntries(entries []*Entry) (string, error)
- func Sync(b *BlobStorage, tree *HashTree, operation func(t *HashTree) error) error
- type ApiCtx
- func (ctx *ApiCtx) CreateDir(parentId, name string, notify bool) (*model.Document, error)
- func (ctx *ApiCtx) DeleteEntry(node *model.Node) error
- func (ctx *ApiCtx) FetchDocument(docId, dstPath string) error
- func (ctx *ApiCtx) Filetree() *filetree.FileTreeCtx
- func (ctx *ApiCtx) MoveEntry(src, dstDir *model.Node, name string) (*model.Node, error)
- func (ctx *ApiCtx) Nuke() (err error)
- func (ctx *ApiCtx) Refresh() error
- func (ctx *ApiCtx) SyncComplete() error
- func (ctx *ApiCtx) UploadDocument(parentId string, sourceDocPath string, notify bool) (*model.Document, error)
- type BlobDoc
- func (d *BlobDoc) AddFile(e *Entry) error
- func (d *BlobDoc) IndexReader() (io.ReadCloser, error)
- func (d *BlobDoc) Line() string
- func (d *BlobDoc) MetadataHashAndReader() (hash string, reader io.Reader, err error)
- func (d *BlobDoc) Mirror(e *Entry, r RemoteStorage) error
- func (d *BlobDoc) ReadMetadata(fileEntry *Entry, r RemoteStorage) error
- func (d *BlobDoc) Rehash() error
- func (d *BlobDoc) ToDocument() *model.Document
- type BlobStorage
- func (b *BlobStorage) GetReader(hash string) (io.ReadCloser, error)
- func (b *BlobStorage) GetRootIndex() (string, int64, error)
- func (b *BlobStorage) GetUrl(hash string) (string, error)
- func (b *BlobStorage) PutRootUrl(hash string, gen int64) (string, int64, error)
- func (b *BlobStorage) PutUrl(hash string) (string, int64, error)
- func (b *BlobStorage) SyncComplete(gen int64) error
- func (b *BlobStorage) UploadBlob(hash string, reader io.Reader) error
- func (b *BlobStorage) WriteRootIndex(roothash string, gen int64) (int64, error)
- type Entry
- type FieldReader
- type HashTree
- type RemoteStorage
- type RemoteStorageWriter
Constants ¶
const Delimiter = ':'
const DocType = "80000000"
const FileType = "0"
const ROOT_NAME = "root"
const SchemaVersion = "3"
Variables ¶
This section is empty.
Functions ¶
func DocumentsFileTree ¶
func DocumentsFileTree(tree *HashTree) *filetree.FileTreeCtx
DocumentsFileTree reads your remote documents and builds a file tree structure to represent them
func HashEntries ¶
Types ¶
type ApiCtx ¶
type ApiCtx struct { Http *transport.HttpClientCtx // contains filtered or unexported fields }
An ApiCtx allows you interact with the remote reMarkable API
func (*ApiCtx) CreateDir ¶
CreateDir creates a remote directory with a given name under the parentId directory
func (*ApiCtx) DeleteEntry ¶
DeleteEntry removes an entry: either an empty directory or a file
func (*ApiCtx) FetchDocument ¶
FetchDocument downloads a document given its ID and saves it locally into dstPath
func (*ApiCtx) Filetree ¶
func (ctx *ApiCtx) Filetree() *filetree.FileTreeCtx
func (*ApiCtx) MoveEntry ¶
MoveEntry moves an entry (either a directory or a file) - src is the source node to be moved - dstDir is an existing destination directory - name is the new name of the moved entry in the destination directory
func (*ApiCtx) SyncComplete ¶ added in v0.0.19
SyncComplete notfies that somethings has changed (triggers tablet sync)
type BlobDoc ¶
type BlobDoc struct { Files []*Entry Entry Metadata archive.MetadataFile }
func NewBlobDoc ¶
func (*BlobDoc) IndexReader ¶
func (d *BlobDoc) IndexReader() (io.ReadCloser, error)
func (*BlobDoc) MetadataHashAndReader ¶
func (*BlobDoc) Mirror ¶
func (d *BlobDoc) Mirror(e *Entry, r RemoteStorage) error
Mirror updates the document to be the same as the remote
func (*BlobDoc) ReadMetadata ¶
func (d *BlobDoc) ReadMetadata(fileEntry *Entry, r RemoteStorage) error
ReadMetadata the document metadata from remote blob
func (*BlobDoc) ToDocument ¶
type BlobStorage ¶
type BlobStorage struct {
// contains filtered or unexported fields
}
func NewBlobStorage ¶ added in v0.0.23
func NewBlobStorage(http *transport.HttpClientCtx) *BlobStorage
func (*BlobStorage) GetReader ¶
func (b *BlobStorage) GetReader(hash string) (io.ReadCloser, error)
func (*BlobStorage) GetRootIndex ¶
func (b *BlobStorage) GetRootIndex() (string, int64, error)
func (*BlobStorage) PutRootUrl ¶ added in v0.0.22
func (*BlobStorage) PutUrl ¶ added in v0.0.17
func (b *BlobStorage) PutUrl(hash string) (string, int64, error)
func (*BlobStorage) SyncComplete ¶
func (b *BlobStorage) SyncComplete(gen int64) error
SyncComplete notifies that the sync is done
func (*BlobStorage) UploadBlob ¶
func (b *BlobStorage) UploadBlob(hash string, reader io.Reader) error
func (*BlobStorage) WriteRootIndex ¶
func (b *BlobStorage) WriteRootIndex(roothash string, gen int64) (int64, error)
type FieldReader ¶
type FieldReader struct {
// contains filtered or unexported fields
}
func NewFieldReader ¶
func NewFieldReader(line string) FieldReader
func (*FieldReader) HasNext ¶
func (fr *FieldReader) HasNext() bool
func (*FieldReader) Next ¶
func (fr *FieldReader) Next() (string, error)
type HashTree ¶
func BuildTree ¶
func BuildTree(provider RemoteStorage) (*HashTree, error)
func (*HashTree) IndexReader ¶
func (t *HashTree) IndexReader() (io.ReadCloser, error)