Documentation ¶ Overview ¶ Package csv provides a read-only database for the library from the embedded CSV file. Index ¶ type Database func NewDatabase(r io.Reader) (*Database, error) func (d Database) ReadBook(id string) (*book.Book, error) func (d Database) ReadBookHeaders(filter book.Filter, limit, offset int) ([]book.Header, error) func (d Database) ReadBookSubjects(limit, offset int) ([]book.Subject, error) type Dump func NewDump(w io.Writer) *Dump func (d *Dump) Write(books ...book.Book) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Database ¶ type Database struct { Books []book.Book } func NewDatabase ¶ func NewDatabase(r io.Reader) (*Database, error) func (Database) ReadBook ¶ func (d Database) ReadBook(id string) (*book.Book, error) func (Database) ReadBookHeaders ¶ func (d Database) ReadBookHeaders(filter book.Filter, limit, offset int) ([]book.Header, error) func (Database) ReadBookSubjects ¶ func (d Database) ReadBookSubjects(limit, offset int) ([]book.Subject, error) type Dump ¶ type Dump struct { // contains filtered or unexported fields } func NewDump ¶ func NewDump(w io.Writer) *Dump func (*Dump) Write ¶ func (d *Dump) Write(books ...book.Book) Source Files ¶ View all Source files database.go Click to show internal directories. Click to hide internal directories.