localdb

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database is a simple wrapper around a JSON-based file.

func Open

func Open(documentDir string) (*Database, error)

Open reads the database file from the given directory. An error is returned if the file doesn't exist or cannot be read. There can only be 1 database per directory.

func (*Database) Close

func (d *Database) Close() error

Close saves the database.

func (*Database) FindByID

func (d *Database) FindByID(id int) *paperless.Document

FindByID returns the document by the given ID, or nil if not existing.

func (*Database) GetAll

func (d *Database) GetAll() []paperless.Document

GetAll returns all documents sorted by ID.

func (*Database) Put

func (d *Database) Put(doc paperless.Document)

Put adds or updates a document.

func (*Database) Remove

func (d *Database) Remove(doc paperless.Document)

Remove deletes the given document

Jump to

Keyboard shortcuts

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