Documentation ¶
Index ¶
- Variables
- type Database
- func (d *Database) Add(c *clinote.Credential) error
- func (d *Database) Close() error
- func (d *Database) GetAll() ([]*clinote.Credential, error)
- func (d *Database) GetByIndex(index int) (*clinote.Credential, error)
- func (d *Database) GetNoteRecoveryPoint() (*clinote.Note, error)
- func (d *Database) GetNotebookCache() (*clinote.NotebookCacheList, error)
- func (d *Database) GetSearch() ([]*clinote.Note, error)
- func (d *Database) GetSettings() (*clinote.Settings, error)
- func (d *Database) Remove(c *clinote.Credential) error
- func (d *Database) SaveNoteRecoveryPoint(note *clinote.Note) error
- func (d *Database) SaveSearch(notes []*clinote.Note) error
- func (d *Database) StoreNotebookList(list *clinote.NotebookCacheList) error
- func (d *Database) StoreSettings(settings *clinote.Settings) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIndexOutOfRange is returned if an index is out of range. ErrIndexOutOfRange = errors.New("index out of range") // ErrEncodeDBVersion is returned if the database version fails to be encoded. ErrEncodeDBVersion = errors.New("failed to encode db version") )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a representation of the backend storage.
func (*Database) Add ¶ added in v0.5.0
func (d *Database) Add(c *clinote.Credential) error
Add adds a new credential to the database.
func (*Database) GetAll ¶ added in v0.5.0
func (d *Database) GetAll() ([]*clinote.Credential, error)
GetAll returns all the credentials in the database.
func (*Database) GetByIndex ¶ added in v0.5.0
func (d *Database) GetByIndex(index int) (*clinote.Credential, error)
GetByIndex returns a credential by its index.
func (*Database) GetNoteRecoveryPoint ¶ added in v0.5.0
GetNoteRecoveryPoint returns the saved note that failed to save.
func (*Database) GetNotebookCache ¶
func (d *Database) GetNotebookCache() (*clinote.NotebookCacheList, error)
GetNotebookCache returns the stored NotebookCacheList.
func (*Database) GetSettings ¶
GetSettings returns the settings from the database.
func (*Database) Remove ¶ added in v0.5.0
func (d *Database) Remove(c *clinote.Credential) error
Remove removes the credential from the database.
func (*Database) SaveNoteRecoveryPoint ¶ added in v0.5.0
SaveNoteRecoveryPoint saves the note to the database so it can be recovered in the case something fails.
func (*Database) SaveSearch ¶
SaveSearch stores the search to the database.
func (*Database) StoreNotebookList ¶
func (d *Database) StoreNotebookList(list *clinote.NotebookCacheList) error
StoreNotebookList saves the list to the database.
Click to show internal directories.
Click to hide internal directories.