Documentation ¶
Overview ¶
Package database implements the database for the scanning cabinet.
Index ¶
- Variables
- type DB
- func (db *DB) Delete(doc *Doc) error
- func (db *DB) Enum(sortBy string, offset, count int) ([]*Doc, error)
- func (db *DB) Pending(sortBy string, offset, count int) ([]*Doc, error)
- func (db *DB) Search(query, sortBy string, offset, count int) ([]*Doc, error)
- func (db *DB) SearchFile(name string) (*Doc, error)
- func (db *DB) SearchID(id int64) (*Doc, error)
- func (db *DB) Thumb(doc *Doc, page, dpi int) ([]byte, error)
- func (db *DB) Write(doc *Doc) error
- type Doc
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("file not found")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
A DB holds metadata for the scanning cabinet. The actual scans are stored separately, as ordinary files.
func (*DB) Delete ¶
Delete deletes the document (or any document with the same doc.ID) from the database.
func (*DB) Enum ¶
Enum enumerates all the documents in the database, sorting them by 'sortBy', and then returning at most count documents after skipping offset.
func (*DB) Pending ¶
Pending enumerates the unfiled documents in the database, sorting them by 'sortBy', and then returning at most count documents after skipping offset.
func (*DB) Search ¶
Search returns documents matching query, an SQLITE full-text search. The results are ordered by 'sortBy', and at most count results are returned after skipping the first offset results.
func (*DB) SearchFile ¶
SearchFile searches the database for the document describing the named file.