Documentation
¶
Index ¶
- func CleanCacheItems(db *storm.DB, items Items, close bool) error
- func DeleteCacheItems(db *storm.DB, items Items, close bool) error
- func GenCacheDBPath(session Session, dir, appName string) (string, error)
- func SaveCacheItems(db *storm.DB, items Items, close bool) error
- func SaveEncryptedItems(db *storm.DB, items items.EncryptedItems, close bool) error
- func SaveItems(s *Session, db *storm.DB, its items.Items, close bool) error
- func SaveNotes(s *Session, db *storm.DB, items items.Notes, close bool) error
- func SaveTags(db *storm.DB, s *Session, items items.Tags, close bool) error
- type CleanInput
- type Item
- type Items
- type Session
- type SyncInput
- type SyncOutput
- type SyncToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanCacheItems ¶
CleanCacheItems marks Cache Items as clean (Dirty = false) and resets dirtied date to the provided database.
func DeleteCacheItems ¶
DeleteCacheItems saves Cache Items to the provided database.
func GenCacheDBPath ¶
GenCacheDBPath generates a path to a database file to be used as a cache of encrypted items The filename is a SHA2 hash of a concatenation of the following in order to be both unique and avoid concurrent usage: - part of the session authentication key (so that caches are unique to a user) - the server URL (so that caches are server specific) - the requesting application name (so that caches are application specific).
func SaveCacheItems ¶
SaveCacheItems saves Cache Items to the provided database.
func SaveEncryptedItems ¶
func SaveEncryptedItems(db *storm.DB, items items.EncryptedItems, close bool) error
SaveEncryptedItems converts to cache items and persists to db.
Types ¶
type CleanInput ¶
type Items ¶
type Items []Item
func ToCacheItems ¶
func ToCacheItems(items items.EncryptedItems, clean bool) (pitems Items)
func (Items) ValidateSaved ¶
type Session ¶
func GetSession ¶
func GetSession(httpClient *retryablehttp.Client, loadSession bool, sessionKey, server string, debug bool) (s Session, email string, err error)
GetSession returns a cache session that encapsulates a gosn-v2 session with additional configuration for managing a local cache database.
func ImportSession ¶
func ImportSession(gs *auth.SignInResponseDataSession, path string) (s *Session, err error)
ImportSession creates a new Session from an existing gosn.Session instance with the option of specifying a path for the db other than the home folder.
type SyncOutput ¶
type SyncOutput struct {
DB *storm.DB
}
func Sync ¶
func Sync(si SyncInput) (so SyncOutput, err error)
Sync will push any dirty items to SN and make database cache consistent with SN.