db

package
v0.0.0-...-86f5664 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AVAILABLE_BOOKS          = "availableBooks"
	SERIES_CRAWL_BOOKS       = "seriesCrawlBooks"
	RECENT_CRAWL_BREADCRUMBS = "recentCrawlBreadcrumbs"
	RECENT_CRAWL_REPORTS     = "recentCrawlReports"
)
View Source
var (
	AUTOMATED_BOOK_SHELF_CRAWL_TIME               = "automatedBookShelfCrawlTime"
	DISCORD_WEBHOOK_URL                           = "discordWebHookURL"
	DISCORD_MESSAGE_FORMAT                        = "discordMessageFormat"
	SEND_ALERT_WHEN_BOOK_NO_LONGER_AVAILABLE      = "sendAlertWhenBookNoLongerAvailable"
	SEND_ALERT_ONLY_WHEN_FREE_SHIPPING_KICKS_IN   = "sendAlertWhenFreeShippingKicksIn"
	TOTAL_BOOKS_IN_AUTOMATED_BOOK_SHELF           = "totalBooksInAutomatedBookShelf"
	ADD_MORE_AUTHOR_BOOKS_TO_AVAILABLE_BOOKS_LIST = "addMoreAuthorBooksToAvailableBooksList"
	KNOWN_AUTHORS                                 = "knownAuthors"
	IGNORE_AUTHORS                                = "ignoreAuthors"
	OTHER_BOOKS_IN_SERIES_LOOKUP                  = "otherBooksInSeriesLookup"
	OWNED_BOOKS_SHELF_URL                         = "ownedBooksShelfURL"
	ONLY_ENGLISH_BOOKS_TOGGLE                     = "onlyEnglishBooksToggle"
	SHELVES_TO_CRAWL                              = "shelvesToCrawl"
)
View Source
var (
	ANYTHING_BUT_LETTERS_AND_SPACES = regexp.MustCompile(`[^A-Za-z0-9 ]`)
)
View Source
var (
	DEFAULT_TTL = time.Duration(0)
)

Functions

func AddAuthorToKnownAuthors

func AddAuthorToKnownAuthors(author string)

func AddAvailableBook

func AddAvailableBook(newBook dtos.AvailableBook)

func AddNewCrawlBreadcrumb

func AddNewCrawlBreadcrumb(shelfURL string, bookCount int)

func AddNewRecentCrawlReport

func AddNewRecentCrawlReport(crawlReport dtos.AutomatedCrawlReport)

func AddOtherAuthorBooksIfFound

func AddOtherAuthorBooksIfFound() bool

func AddShelfToShelvesToCrawl

func AddShelfToShelvesToCrawl(newShelf dtos.ShelfToCrawl)

func ConnectToRedis

func ConnectToRedis()

func GetAutomatedBookShelfCrawlTime

func GetAutomatedBookShelfCrawlTime() string

func GetAvailableBooks

func GetAvailableBooks() []dtos.AvailableBook

func GetAvailableBooksMap

func GetAvailableBooksMap() map[string]bool

func GetDiscordMessageFormat

func GetDiscordMessageFormat() string

func GetDiscordWebhookURL

func GetDiscordWebhookURL() string

func GetIgnoredAndNonIgnoredCountOfAvailableBooks

func GetIgnoredAndNonIgnoredCountOfAvailableBooks() (int, int)

func GetKeyForRecentCrawlBreadcrumb

func GetKeyForRecentCrawlBreadcrumb(shelfURL string) string

func GetKnownAuthors

func GetKnownAuthors() []dtos.KnownAuthor

func GetMapForAvailableBooks

func GetMapForAvailableBooks(availableBooks []dtos.AvailableBook) map[string]bool

func GetOnlyEnglishBooks

func GetOnlyEnglishBooks() bool

func GetOwnedBooksShelfURL

func GetOwnedBooksShelfURL() string

func GetRecentCrawlBreadcrumbs

func GetRecentCrawlBreadcrumbs() []dtos.RecentCrawlBreadcrumb

func GetRecentCrawlReports

func GetRecentCrawlReports() []dtos.AutomatedCrawlReport

func GetSendAlertOnlyWhenFreeShippingKicksIn

func GetSendAlertOnlyWhenFreeShippingKicksIn() bool

func GetSendAlertWhenBookNoLongerAvailable

func GetSendAlertWhenBookNoLongerAvailable() bool

func GetSeriesCrawlBooks

func GetSeriesCrawlBooks() []dtos.Series

func GetShelfCrawlKeysFromShelvesToCrawl

func GetShelfCrawlKeysFromShelvesToCrawl() []string

func GetShelfURLsFromShelvesToCrawl

func GetShelfURLsFromShelvesToCrawl() []string

func GetShelvesToCrawl

func GetShelvesToCrawl() []dtos.ShelfToCrawl

func GetTotalBooksInAutomatedBookShelfCheck

func GetTotalBooksInAutomatedBookShelfCheck() int

func IgnoreBook

func IgnoreBook(bookURL string)

func IsIgnoredAuthor

func IsIgnoredAuthor(author string) bool

func PurgeIgnoredAuthorsFromAvailableBooks

func PurgeIgnoredAuthorsFromAvailableBooks()

func RemoveAvailableBook

func RemoveAvailableBook(bookToRemove dtos.AvailableBook)

func RemoveShelfFromShelvesToCrawl

func RemoveShelfFromShelvesToCrawl(shelfURLToRemove string)

func ResetAvailableBooks

func ResetAvailableBooks()

func SearchOtherSeriesBooksLookup

func SearchOtherSeriesBooksLookup() bool

func SetAddMoreAuthorBooksToAvailableBooksList

func SetAddMoreAuthorBooksToAvailableBooksList(enabled bool)

func SetAutomatedBookShelfCrawlTime

func SetAutomatedBookShelfCrawlTime(time string)

func SetAvailableBooks

func SetAvailableBooks(availableBooks []dtos.AvailableBook)

func SetDiscordMessageFormat

func SetDiscordMessageFormat(format string)

func SetDiscordWebhookURL

func SetDiscordWebhookURL(webhookURL string)

func SetKnownAuthors

func SetKnownAuthors(authors []dtos.KnownAuthor)

func SetLogger

func SetLogger(newLogger *zap.Logger)

func SetOnlyEnglishBooks

func SetOnlyEnglishBooks(enabled bool)

func SetOwnedBooksShelfURL

func SetOwnedBooksShelfURL(shelfURL string)

func SetRecentCrawlBreadcrumbs

func SetRecentCrawlBreadcrumbs(breadCrumbs []dtos.RecentCrawlBreadcrumb)

func SetRecentCrawlReports

func SetRecentCrawlReports(crawlReports []dtos.AutomatedCrawlReport)

func SetSearchOtherSeriesBooksLookup

func SetSearchOtherSeriesBooksLookup(enabled bool)

func SetSendAlertOnlyWhenFreeShippingKicksIn

func SetSendAlertOnlyWhenFreeShippingKicksIn(enabled bool)

func SetSendAlertWhenBookNoLongerAvailable

func SetSendAlertWhenBookNoLongerAvailable(enabled bool)

func SetSeriesCrawlBooks

func SetSeriesCrawlBooks(seriesCrawlBooks []dtos.Series)

func SetTestDataIdentifiers

func SetTestDataIdentifiers()

func SetTotalBooksInAutomatedBookShelfCheck

func SetTotalBooksInAutomatedBookShelfCheck(totalBooks int)

func ToggleAuthorIgnore

func ToggleAuthorIgnore(authorToSearch string)

func UnignoreBook

func UnignoreBook(bookURL string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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