Documentation ¶
Index ¶
- type Storage
- func (s *Storage) AddNewQuery(term string, city string, radius int, price *int, minPrice *int, chatID int64) (*model.Query, error)
- func (s *Storage) CloseDB()
- func (s *Storage) DeleteOlderAds() (int64, error)
- func (s *Storage) FindQueryByID(id uint) *model.Query
- func (s *Storage) GetLatest(id uint) []scraper.Ad
- func (s *Storage) GetQueries() []model.Query
- func (s *Storage) ListForChatID(chatID int64) []model.Query
- func (s *Storage) RemoveByChatID(chatID int64) (int, error)
- func (s *Storage) RemoveByID(id uint, chatID int64) *model.Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is the main storage medium
func (*Storage) AddNewQuery ¶
func (s *Storage) AddNewQuery(term string, city string, radius int, price *int, minPrice *int, chatID int64) (*model.Query, error)
AddNewQuery adds a new query to the db
func (*Storage) DeleteOlderAds ¶
DeleteOlderAds deletes all ads older that 7 days
func (*Storage) FindQueryByID ¶
FindQueryByID find a query by the given id
func (*Storage) GetLatest ¶
GetLatest fetches the latest ads from kleinanzeigen. All ads where the id is not in the db is returned and the db is updated with the latest ads
func (*Storage) GetQueries ¶
GetQueries gets all the queries from the db
func (*Storage) ListForChatID ¶
ListForChatID gets all the queries for specified chatId
func (*Storage) RemoveByChatID ¶
RemoveByChatID removes all queries for a chat id
Click to show internal directories.
Click to hide internal directories.