archive

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: 8 Imported by: 0

Documentation

Overview

Package archive is used to parse a .zip file retrieved by the API.

Here is the content of an archive retried on the tablet as example: 384327f5-133e-49c8-82ff-30aa19f3cfa4.content 384327f5-133e-49c8-82ff-30aa19f3cfa4//0-metadata.json 384327f5-133e-49c8-82ff-30aa19f3cfa4//0.rm 384327f5-133e-49c8-82ff-30aa19f3cfa4.pagedata 384327f5-133e-49c8-82ff-30aa19f3cfa4.thumbnails/0.jpg

As the .zip file from remarkable is simply a normal .zip file containing specific file formats, this package is only a wrapper around the standard zip package that will follow the same code architecture and that will help gathering one of those specific files more easily.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Data      *zip.File
	Metadata  *zip.File
	Thumbnail *zip.File
}

A Page represents a note page.

type Reader

type Reader struct {
	Content  *zip.File
	Pagedata *zip.File
	Pages    []Page
	Pdf      *zip.File
	Epub     *zip.File
	UUID     string
}

Reader will parse specific files of the remarkable zip file.

func OpenReader

func OpenReader(name string) (*Reader, error)

OpenReader opens a reader from a zip file name. The UUID is taken from the Content or Pagadata file name.

func (Reader) String

func (r Reader) String() string

type Writer

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

Writer is for writing a remarkable .zip The uuid should be unique across notes.

func NewWriter

func NewWriter(w io.Writer, uuid string) *Writer

NewWriter creates a Writer from an io.Writer. The uuid will be used for file names as done by the remarkable device.

func (*Writer) Close

func (w *Writer) Close() error

Close finishes writing the zip file.

func (*Writer) CreateContent

func (w *Writer) CreateContent() (io.Writer, error)

CreateContent is for writing a content file.

func (*Writer) CreateEpub

func (w *Writer) CreateEpub() (io.Writer, error)

CreateEpub is for writing an epub file.

func (*Writer) CreatePage

func (w *Writer) CreatePage(idx int) (io.Writer, error)

CreatePage is for writing a page data. The argument idx serves for file names.

func (*Writer) CreatePageMetadata

func (w *Writer) CreatePageMetadata(idx int) (io.Writer, error)

CreatePageMetadata is for writing a page metadata. The argument idx serves for file names.

func (*Writer) CreatePagedata

func (w *Writer) CreatePagedata() (io.Writer, error)

CreatePagedata is for writing a pagedata file.

func (*Writer) CreatePdf

func (w *Writer) CreatePdf() (io.Writer, error)

CreatePdf is for writing a pdf file.

func (*Writer) CreateThumbnail

func (w *Writer) CreateThumbnail(idx int) (io.Writer, error)

CreateThumbnail is for writing a thumbnail file. The argument idx is used for file names.

Jump to

Keyboard shortcuts

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