Documentation ¶
Index ¶
- Constants
- Variables
- func CaptureCoverImages(books []Book, imageDir string) error
- func CreateBooksDatabase(databaseName string) *gorm.DB
- func ExtractSurname(fullName string) string
- func TransferJsonBooksToDatabase(jsonFileName string, db *gorm.DB) error
- type Author
- type Book
- func (b Book) BookPageLink() template.HTML
- func (b Book) Create(db *gorm.DB) (uint, error)
- func (b Book) DisplayRating() string
- func (b Book) FormatTitle() string
- func (b Book) MakeCoverImageFilename(imageDir string, size string) string
- func (b Book) MakeCoverImageUrl(size string) string
- func (b Book) MakeLinkedMediumCoverImageTag() template.HTML
- func (b Book) MakeLinkedSmallCoverImageTag() template.HTML
- func (b Book) SiteFileName() string
- type BookSearchResult
- type BooksByAuthor
- type OpenLibraryBookAuthor
- type OpenLibraryBookIsbn
- type Rating
Constants ¶
View Source
const ImageDir string = "images/cover_images"
View Source
const LargeCover = "L"
View Source
const MediumCover = "M"
View Source
const Missing int64 = -999998
View Source
const SmallCover = "S"
View Source
const Verbose bool = false
Variables ¶
Functions ¶
func CaptureCoverImages ¶
func CreateBooksDatabase ¶
func ExtractSurname ¶
This might need to get more sophisticated
Types ¶
type Book ¶
type Book struct { gorm.Model PubDate int64 DateAdded time.Time AuthorFullName string AuthorSurname string MainTitle string SubTitle string Review string Rating string AmazonLink string CoverImageUrl string OpenLibraryUrl string IsfdbUrl string OpenLibraryBookIsbns []OpenLibraryBookIsbn OlCoverId int64 // Used as the base ID for the image (add suffix -M, -S, -L for sizing.) OpenLibraryBookAuthors []OpenLibraryBookAuthor OlCoverEditionId string // Used to pull up an entry based on a cover Authors []Author `gorm:"many2many:book_authors;"` }
func (Book) BookPageLink ¶
func (Book) DisplayRating ¶
func (Book) FormatTitle ¶
func (Book) MakeCoverImageFilename ¶
func (Book) MakeCoverImageUrl ¶
func (Book) MakeLinkedMediumCoverImageTag ¶
func (Book) MakeLinkedSmallCoverImageTag ¶
func (Book) SiteFileName ¶
type BookSearchResult ¶
type BookSearchResult struct { Number int FirstYearPublished int Title string Author string AmazonId string CoverEditionKey string EditionIds []string // all editions AuthorIds []string // Can be more than one author }
func SearchBook ¶
func SearchBook(title string, author string) []BookSearchResult
func (BookSearchResult) Print ¶
func (s BookSearchResult) Print()
type BooksByAuthor ¶
func AllBooksFromJson ¶
func AllBooksFromJson(bookFile string) BooksByAuthor
type OpenLibraryBookAuthor ¶
type Rating ¶
type Rating struct {
// contains filtered or unexported fields
}
func StringToRating ¶
Click to show internal directories.
Click to hide internal directories.