database

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePriceAgentForUser

func CreatePriceAgentForUser(priceAgent *models.PriceAgent) error

func CreateUser

func CreateUser(user models.User) error

func CreateUserWithCache

func CreateUserWithCache(user models.User)

CreateUserWithCache checks if a user already exists in cache/db and creates a user in the database and cache if it does not exist

func DeleteDisabledPriceagents

func DeleteDisabledPriceagents() error

func DeletePriceAgentForUser

func DeletePriceAgentForUser(priceAgent models.PriceAgent) error

func DeleteUser

func DeleteUser(userID int64)

DeleteUser deletes a user and their PriceAgents from the database

func DeleteUserWithCache

func DeleteUserWithCache(userID int64)

func GetActivePriceAgents

func GetActivePriceAgents() ([]models.PriceAgent, error)

func GetAllEntities

func GetAllEntities() ([]geizhals.Entity, error)

func GetAllEntitiesWithPriceagents

func GetAllEntitiesWithPriceagents() ([]geizhals.Entity, error)

func GetAllUsers

func GetAllUsers() []models.User

func GetDarkmode

func GetDarkmode(userID int64) bool

func GetPriceAgentCount

func GetPriceAgentCount() int64

func GetPriceAgentCountForUser

func GetPriceAgentCountForUser(userID int64) int64

func GetPriceAgentProductCount

func GetPriceAgentProductCount() int64

func GetPriceAgentWishlistCount

func GetPriceAgentWishlistCount() int64

func GetPriceAgentsForEntity

func GetPriceAgentsForEntity(entityID int64) ([]models.PriceAgent, error)

GetPriceAgentsForEntity returns all priceagents for a given entity

func GetPriceagentForUserByID

func GetPriceagentForUserByID(userID int64, priceagentID int64) (models.PriceAgent, error)

func GetProductPriceagentsForUser

func GetProductPriceagentsForUser(userID int64) ([]models.PriceAgent, error)

func GetUserCount

func GetUserCount() int64

func GetUserFromCache

func GetUserFromCache(userID int64) models.User

func GetWishlistPriceagentsForUser

func GetWishlistPriceagentsForUser(userID int64) ([]models.PriceAgent, error)

func HasUserPriceAgentForEntity

func HasUserPriceAgentForEntity(userID int64, entityID int64) (bool, error)

HasUserPriceAgentForEntity checks if a user already has a priceagent for a given entity

func InitDB

func InitDB()

func PopulateCaches

func PopulateCaches()

PopulateCaches populates all the caches from the database

func UpdateDarkMode

func UpdateDarkMode(userID int64, darkMode bool)

func UpdateEntity

func UpdateEntity(entity geizhals.Entity)

func UpdateEntityPrice

func UpdateEntityPrice(price geizhals.EntityPrice)

func UpdateNotificationSettings

func UpdateNotificationSettings(userID int64, priceagentID int64, notifSettings models.NotificationSettings) error

func UpdatePriceagent

func UpdatePriceagent(priceagent models.PriceAgent) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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