Documentation
¶
Index ¶
- Variables
- 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 gosn.EncryptedItems, close bool) error
- func SaveItems(s *Session, db *storm.DB, items gosn.Items, close bool) error
- func SaveNotes(s *Session, db *storm.DB, items gosn.Notes, close bool) error
- func SaveTags(db *storm.DB, s *Session, items gosn.Tags, close bool) error
- type CleanInput
- type Item
- type Items
- type Session
- type SyncInput
- type SyncOutput
- type SyncToken
Constants ¶
This section is empty.
Variables ¶
var HiWhite = color.New(color.FgHiWhite).SprintFunc()
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 ¶
SaveEncryptedItems converts to cache items and persists to db.
Types ¶
type CleanInput ¶
type Session ¶
func GetSession ¶
func GetSession(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 ¶
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.