Documentation
¶
Index ¶
- Variables
- type Book
- type Progress
- type ReadingList
- type ReadingService
- func (r *ReadingService) AddBook(b Book, success *bool) error
- func (r *ReadingService) AdvanceProgress(p Progress, success *bool) error
- func (r *ReadingService) GetProgress(isbn string, pages *int) (err error)
- func (r *ReadingService) RemoveBook(isbn string, success *bool) error
- func (r *ReadingService) SetProgress(p Progress, success *bool) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrISBN = fmt.Errorf("missing ISBN") ErrDuplicate = fmt.Errorf("duplicate book") ErrMissing = fmt.Errorf("missing book") )
List of errors
Functions ¶
This section is empty.
Types ¶
type ReadingList ¶
ReadingList keeps tracks of books and pages read
func (*ReadingList) AddBook ¶
func (r *ReadingList) AddBook(b Book) error
AddBook checks if the book is not present and adds it
func (*ReadingList) AdvanceProgress ¶
func (r *ReadingList) AdvanceProgress(isbn string, pages int) error
AdvanceProgress adds the pages the progress of a book
func (*ReadingList) GetProgress ¶
func (r *ReadingList) GetProgress(isbn string) (int, error)
GetProgress returns the progress of abbok
func (*ReadingList) RemoveBook ¶
func (r *ReadingList) RemoveBook(isbn string) error
RemoveBook removes the book from list and forgets its progress
func (*ReadingList) SetProgress ¶
func (r *ReadingList) SetProgress(isbn string, pages int) error
SetProgress changes the progress of a book
type ReadingService ¶
type ReadingService struct {
ReadingList
}
ReadingService adapts ReadingList for RPC
func (*ReadingService) AdvanceProgress ¶
func (r *ReadingService) AdvanceProgress(p Progress, success *bool) error
func (*ReadingService) GetProgress ¶
func (r *ReadingService) GetProgress(isbn string, pages *int) (err error)
func (*ReadingService) RemoveBook ¶
func (r *ReadingService) RemoveBook(isbn string, success *bool) error
func (*ReadingService) SetProgress ¶
func (r *ReadingService) SetProgress(p Progress, success *bool) error
Click to show internal directories.
Click to hide internal directories.