booklist

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorList

type AuthorList []struct{ Name, ID string }

func (AuthorList) Sorted

func (al AuthorList) Sorted(less func(a, b struct{ Name, ID string }) bool) AuthorList

type Book

type Book struct {
	Hash     string
	FilePath string
	FileSize int64
	ModTime  time.Time

	HasCover    bool
	Title       string
	Author      string
	Description string
	Series      string
	SeriesIndex float64
	Publisher   string
}

func (*Book) AuthorID

func (b *Book) AuthorID() string

func (*Book) FileType

func (b *Book) FileType() string

func (*Book) ID

func (b *Book) ID() string

func (*Book) SeriesID

func (b *Book) SeriesID() string

type BookList

type BookList []*Book

func (BookList) Authors

func (bl BookList) Authors() *AuthorList

func (BookList) Filtered

func (bl BookList) Filtered(fn func(b *Book) bool) BookList

func (BookList) Series

func (bl BookList) Series() *SeriesList

func (BookList) Skip

func (bl BookList) Skip(n int) BookList

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 (bl BookList) Sorted(less func(a, b *Book) bool) BookList

func (BookList) Take

func (bl BookList) Take(n int) BookList

type SeriesList

type SeriesList []struct{ Name, ID string }

func (SeriesList) Sorted

func (sl SeriesList) Sorted(less func(a, b struct{ Name, ID string }) bool) SeriesList

Jump to

Keyboard shortcuts

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