data

package
v0.0.0-...-57cd8ea Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EPUB = "application/epub+zip"
	MOBI = "application/x-mobipocket-ebook"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID       string    `json:"id"`
	Title    string    `json:"title"`
	Author   string    `json:"author"`
	Added    time.Time `json:"added"`
	Editions Editions  `json:"editions"`
}

func (Book) Slug

func (b Book) Slug(edition *Edition) string

type Books

type Books []*Book

type DB

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

func Open

func Open(path string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Find

func (db *DB) Find(id string) (book Book, ok bool)

func (*DB) FindEdition

func (db *DB) FindEdition(id string) (*Edition, *Book, bool)

func (*DB) Get

func (db *DB) Get() (Books, error)

func (*DB) Remove

func (db *DB) Remove(book Book) error

func (*DB) Save

func (db *DB) Save(book Book) error

type Edition

type Edition struct {
	ID          string `json:"id"`
	ContentType string `json:"content-type"`
}

func (Edition) Extension

func (e Edition) Extension() string

func (Edition) Path

func (e Edition) Path() string

type Editions

type Editions []*Edition

Jump to

Keyboard shortcuts

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