Documentation
¶
Index ¶
- func GetDB() (db *sql.DB, err error)
- type BookIndex
- type BookStore
- type CollectionStore
- type Store
- func (store *Store) Get(id string) (*ebook.Book, error)
- func (store *Store) GetCollectionLastModification() (time.Time, error)
- func (store *Store) GetLastModification(id string) (time.Time, error)
- func (store *Store) HasChanged(path string, lastMod time.Time) (bool, error)
- func (store *Store) InsertBook(book *ebook.Book) (string, error)
- func (store *Store) Recent() ([]ebook.Book, error)
- func (store *Store) Search(query string) ([]ebook.Book, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BookIndex ¶
type BookIndex interface { // Insert a single book in the index InsertBook(book *ebook.Book) (string, error) // Check if book should be indexed, based on last modification time HasChanged(path string, lastMod time.Time) (bool, error) }
BookIndex provides write access to the ebook index
type BookStore ¶
type BookStore interface { // Retrieve recent books Recent() ([]ebook.Book, error) // Fetch a book by its ID Get(id string) (*ebook.Book, error) // Search an ebook by title, author or series Search(query string) ([]ebook.Book, error) GetLastModification(id string) (time.Time, error) }
BookStore provides a read access to the ebook index
type CollectionStore ¶
CollectionStore allow to query the collection as a whole
type Store ¶
Store wraps a database connection to act as a database abstraction layer
func (*Store) GetCollectionLastModification ¶
GetCollectionLastModification will return the most recent mod_time
func (*Store) GetLastModification ¶
GetLastModification returns the modification time for a given book
func (*Store) HasChanged ¶
HasChanged will return false if the book is known and its modification date is not more recent that what is stored in the index. This will return true for any new book (not present in the index).
func (*Store) InsertBook ¶
InsertBook will store a single book in the index
Click to show internal directories.
Click to hide internal directories.