snpersist

package module
v0.0.0-...-7bd51f5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 5 Imported by: 0

README

sn-persist

standard notes persistence

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	UUID        string `storm:"id,unique"`
	Content     string
	ContentType string `storm:"index"`
	EncItemKey  string
	Deleted     bool `storm:"index"`
	CreatedAt   string
	UpdatedAt   string
	Dirty       bool
	DirtiedDate time.Time
}

func ConvertItemsToPersistItems

func ConvertItemsToPersistItems(items gosn.EncryptedItems) (pitems []Item)

type Items

type Items []Item

func (Items) ToItems

func (pi Items) ToItems(session gosn.Session) (items gosn.Items, err error)

type SyncInput

type SyncInput struct {
	Session gosn.Session
	DB      *storm.DB // pointer to an existing DB
	DBPath  string    // path to create new DB
}

type SyncOutput

type SyncOutput struct {
	Items, SavedItems, Unsaved gosn.EncryptedItems // only used for testing purposes!?
	//syncToken, cursorToken     string              // only used for testing purposes!?
	DB *storm.DB // pointer to DB (same if passed in SyncInput, new if called without existing)
}

func Sync

func Sync(si SyncInput) (so SyncOutput, err error)

type SyncToken

type SyncToken struct {
	SyncToken string `storm:"id,unique"`
}

Jump to

Keyboard shortcuts

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