fs

package
v0.0.0-...-18a76ad Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(path string) rmtool.Repository

NewRepository creates a repository backed by the local file system.

The given path should point to a directory similar to the storage directory on the remarkable tablet.

Types

type Metadata

type Metadata struct {
	// LastModified is the UTC date of the last edit as a Unix timestamp.
	LastModified Timestamp `json:"lastModified"`
	// Version is incremented with each change to the file, starting at "1".
	Version uint `json:"version"`
	// LastOpenedPage is set by the tablet to the page that was last viewed.
	LastOpenedPage uint `json:"lastOpenedPage"`
	// Parent is the ID of the parent folder.
	// It is empty if the notebook is located in the root folder.
	// It can also be set to the special value "trash" if the notebook is deleted.
	Parent string `json:"parent"`
	// Pinned is the bookmark/start for a notebook.
	Pinned bool `json:"pinned"`
	// Type tells whether this is a document or a folder.
	Type rm.NotebookType `json:"type"`
	// VisibleName is the display name for this item.
	VisibleName string `json:"visibleName"`
	// Deleted seems to be used internally by the tablet(?).
	Deleted bool `json:"deleted"`
	// MetadataModified seems to be used internally by the tablet(?).
	MetadataModified bool `json:"metadatamodified"`
	// Modified seems to be used internally by the tablet(?).
	Modified bool `json:"modified"`
	// Synced seems to be used internally by the tablet(?).
	Synced bool `json:"synced"`
}

Metadata holds the metadata for a notebook.

This maps to the .metadata file from the tablet's file system.

func (*Metadata) Validate

func (m *Metadata) Validate() error

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp is the datatype for a UNIX timestamp in string format.

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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