booklist

package
v3.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBookListFromDir

func NewBookListFromDir(dir, coverOutDir string, verbose, nocovers bool) (*BookList, []*IndexerError)

NewBookListFromDir creates a BookList from a directory of books.

Types

type AuthorList

type AuthorList []*models.Author

AuthorList is a list of authors

func (*AuthorList) Filtered

func (l *AuthorList) Filtered(filterer func(a *models.Author) bool) *AuthorList

Filtered returns a copy of the AuthorList filtered by the function

func (*AuthorList) Sorted

func (l *AuthorList) Sorted(sorter func(a, b *models.Author) bool) *AuthorList

Sorted returns a copy of the AuthorList sorted by the function

type BookList

type BookList []*models.Book

BookList represents a list of Books

func (*BookList) Filtered

func (l *BookList) Filtered(filterer func(a *models.Book) bool) *BookList

Filtered returns a copy of the BookList filtered by the function

func (*BookList) GetAuthors

func (l *BookList) GetAuthors() *AuthorList

GetAuthors gets the authors in a BookList

func (*BookList) GetSeries

func (l *BookList) GetSeries() *SeriesList

GetSeries gets the series in a BookList

func (*BookList) HasAuthor

func (l *BookList) HasAuthor(id string) bool

HasAuthor checks whether an author with an id exists

func (*BookList) HasBook

func (l *BookList) HasBook(id string) bool

HasBook checks whether a book with an id exists

func (*BookList) HasSeries

func (l *BookList) HasSeries(id string) bool

HasSeries checks whether a series with an id exists

func (*BookList) SortBy

func (l *BookList) SortBy(sort string) (nl *BookList, sorted bool)

SortBy sorts by sort, and returns a sorted copy. If sorter is invalid, it returns the original list.

sort can be: - author-asc - author-desc - title-asc - title-desc - series-asc - series-desc - seriesindex-asc - seriesindex-desc - modified-desc

func (*BookList) Sorted

func (l *BookList) Sorted(sorter func(a, b *models.Book) bool) BookList

Sorted returns a copy of the BookList sorted by the function

type IndexerError

type IndexerError struct {
	Filename string
	Error    error
}

IndexerError represents a indexer error.

type SeriesList

type SeriesList []*models.Series

SeriesList is a list of series

func (*SeriesList) Filtered

func (l *SeriesList) Filtered(filterer func(a *models.Series) bool) *SeriesList

Filtered returns a copy of the SeriesList filtered by the function

func (*SeriesList) Sorted

func (l *SeriesList) Sorted(sorter func(a, b *models.Series) bool) *SeriesList

Sorted returns a copy of the SeriesList sorted by the function

Jump to

Keyboard shortcuts

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