Documentation ¶
Index ¶
- Variables
- type Batch
- func (b *Batch) Commit() (*PutResult, error)
- func (b *Batch) FSSnapshot() (fs.FS, error)
- func (b *Batch) GetAndCacheBlob(id string) (*http.Response, error)
- func (b *Batch) List() ([]Item, error)
- func (b *Batch) Mkdir(p string) (*PutResult, error)
- func (b *Batch) Put(p string, ext string, r io.ReadSeeker) (*PutResult, error)
- func (b *Batch) PutBlob(hashKey, id string, r io.Reader, opts ...PutBlobOption) error
- func (b *Batch) Remove(name string) (*PutResult, error)
- func (b *Batch) UpdateRootHash(hashKey string)
- type Client
- func (c *Client) Do(op string, req *http.Request) (*http.Response, error)
- func (c *Client) FSSnapshot() (fs.FS, error)
- func (c *Client) GetBlob(id string) (*http.Response, error)
- func (c *Client) List() ([]Item, error)
- func (c *Client) NewBatch() (*Batch, error)
- func (c *Client) PutRoot(root RootMetadata) (*RootMetadata, error)
- func (c *Client) RawPutBlob(r RawPubBlobRequest, opts ...PutBlobOption) error
- type CredentialProvider
- type Item
- type PutBlobOption
- type PutResult
- type RawPubBlobRequest
- type RootMetadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AuthHost = "https://webapp-prod.cloud.remarkable.engineering" NewDeviceTokenPath = "/token/json/2/device/new" NewUserTokenPath = "/token/json/2/user/new" )
View Source
var ( RootURL = "https://internal.cloud.remarkable.com/sync/v3/root" FileURLPrefix = "https://internal.cloud.remarkable.com/sync/v3/files/" DebugLogFunc func(string, ...interface{}) )
View Source
var RootListingID = "root.docSchema"
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) Mkdir ¶
Mkdir creates a directory synced to the device. On success, Mkdir returns the directory ID.
func (*Batch) Put ¶
Add a file to the batch for uploading. p is the name of the file on the device. It can be a path. ext is the file extension. The only values are "epub" and "pdf". r is a ReadSeeker of the actual content.
func (*Batch) UpdateRootHash ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(creds CredentialProvider) *Client
func (*Client) PutRoot ¶
func (c *Client) PutRoot(root RootMetadata) (*RootMetadata, error)
func (*Client) RawPutBlob ¶
func (c *Client) RawPutBlob(r RawPubBlobRequest, opts ...PutBlobOption) error
type CredentialProvider ¶
type CredentialProvider interface {
Token() string // returns the current refresh token
}
func NewStaticTokenProvider ¶
func NewStaticTokenProvider(deviceToken, userToken string) CredentialProvider
type Item ¶
type Item struct { ID string `json:"__pms_id"` Hash string `json:"__pms_hash"` Deleted bool `json:"deleted"` LastModified string `json:"lastModified"` LastOpened string `json:"lastOpened"` LastOpenedPage int `json:"lastOpenedPage"` Metadatamodified bool `json:"metadatamodified"` Modified bool `json:"modified"` Parent string `json:"parent"` Pinned bool `json:"pinned"` Synced bool `json:"synced"` Type string `json:"type"` Version int `json:"version"` Name string `json:"visibleName"` }
type PutBlobOption ¶
type PutBlobOption func(opt *putBlobOptions)
type RawPubBlobRequest ¶
type RawPubBlobRequest struct { // Sha256 of the content Key string // Remarkable filename (uuid.extension) Filename string ParentHash string Content io.ReadSeeker }
Click to show internal directories.
Click to hide internal directories.