Documentation
¶
Index ¶
- type Payload
- type Service
- func (s *Service) ArchiveBook(book *dusk.Book) error
- func (s *Service) DeleteBook(book *dusk.Book) error
- func (s *Service) ParseBook(payload *Payload) (*dusk.Book, error)
- func (s *Service) UploadBookFormat(payload *Payload, book *dusk.Book) error
- func (s *Service) UploadCoverFromPayload(payload *Payload, book *dusk.Book) error
- func (s *Service) UploadCoverFromUrl(url string, book *dusk.Book) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
func NewPayload ¶
type Service ¶
func NewService ¶
func (*Service) DeleteBook ¶
The full flow of deleting/archiving a book is: 1. Delete book from database 2. Delete book directory from filesystem 3. If step 1 fails, worker should identify orphan directories and flag them
func (*Service) ParseBook ¶
Book format and cover files should not be uploaded to the filesystem directly if they have not been initialized in the database, in case of database errors. This removes the need to perform clean up if any database errors should occur.
As such, the full flow of adding a new book via upload is:
- Parse book from payload
- Add book entry to database
- Upload book files
- Update database with book file paths
func (*Service) UploadBookFormat ¶
Upload new format for existing book
func (*Service) UploadCoverFromPayload ¶
Upload book cover from payload
Click to show internal directories.
Click to hide internal directories.