api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHttpCtx

func AuthHttpCtx() *transport.HttpClientCtx

func DocumentsFileTree

func DocumentsFileTree(http *transport.HttpClientCtx) *filetree.FileTreeCtx

DocumentsFileTree reads your remote documents and builds a file tree structure to represent them

Types

type ApiCtx

type ApiCtx struct {
	Http     *transport.HttpClientCtx
	Filetree *filetree.FileTreeCtx
}

An ApiCtx allows you interact with the remote reMarkable API

func CreateApiCtx

func CreateApiCtx(http *transport.HttpClientCtx) *ApiCtx

CreateApiCtx initializes an instance of ApiCtx

func (*ApiCtx) CreateDir

func (ctx *ApiCtx) CreateDir(parentId, name string) (model.Document, error)

CreateDir creates a remote directory with a given name under the parentId directory

func (*ApiCtx) DeleteEntry

func (ctx *ApiCtx) DeleteEntry(node *model.Node) error

DeleteEntry removes an entry: either an empty directory or a file

func (*ApiCtx) FetchDocument

func (ctx *ApiCtx) FetchDocument(docId, dstPath string) error

FetchDocument downloads a document given its ID and saves it locally into dstPath

func (*ApiCtx) MoveEntry

func (ctx *ApiCtx) MoveEntry(src, dstDir *model.Node, name string) (*model.Node, error)

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) UploadDocument

func (ctx *ApiCtx) UploadDocument(parentId string, sourceDocPath string) (*model.Document, error)

UploadDocument uploads a local document given by sourceDocPath under the parentId directory

Jump to

Keyboard shortcuts

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