Documentation
¶
Index ¶
- type DBConfig
- type FavoriteList
- type FavoriteListItem
- type SearchHistory
- type SearchHistoryResult
- type Storage
- func (storage *Storage) AddItemToList(listID uint, productID uint) error
- func (storage *Storage) Close()
- func (storage *Storage) CreateFavoriteList(list *FavoriteList) error
- func (storage *Storage) CreateSearchHistory(history *SearchHistory) error
- func (storage *Storage) CreateSearchHistoryResult(result *SearchHistoryResult) error
- func (storage *Storage) CreateUnauthorizedToken(token *UnauthorizedToken) error
- func (storage *Storage) CreateUser(user *UserAccount) error
- func (storage *Storage) DeleteUnauthorizedTokensBeforeNow() error
- func (storage *Storage) GetAllUnauthorizedTokens() ([]*UnauthorizedToken, error)
- func (storage *Storage) GetFavoriteListByID(id uint) (*FavoriteList, error)
- func (storage *Storage) GetFavoriteListByUserIDAndName(userID uint, name string) (*FavoriteList, error)
- func (storage *Storage) GetFavoriteListsByUserID(userID uint) (*[]FavoriteList, error)
- func (storage *Storage) GetSearchHistoryByID(id uint) (*SearchHistory, error)
- func (storage *Storage) GetSearchHistoryByUserID(userID uint, offset int, limit int) ([]SearchHistory, error)
- func (storage *Storage) GetUnauthorizedToken(token string) (*UnauthorizedToken, error)
- func (storage *Storage) GetUserByEmail(email string) (*UserAccount, error)
- func (storage *Storage) GetUserByID(id uint) (*UserAccount, error)
- func (storage *Storage) GetUserByPhoneNumber(phoneNumber string) (*UserAccount, error)
- func (storage *Storage) Migrate() error
- func (storage *Storage) RemoveItemFromList(listID uint, productID uint) error
- type UnauthorizedToken
- type UserAccount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConfig ¶
type FavoriteList ¶
type FavoriteList struct {
gorm.Model
UserID uint
User UserAccount `gorm:"ONDELETE:CASCADE"`
Name string
Items []FavoriteListItem
}
type FavoriteListItem ¶
type FavoriteListItem struct {
gorm.Model
FavoriteListID uint
FavoriteList FavoriteList `gorm:"ONDELETE:CASCADE"`
ProductID uint
}
type SearchHistory ¶
type SearchHistory struct {
gorm.Model
UserID uint
User UserAccount `gorm:"ONDELETE:CASCADE"`
QueryAddress string
Results []SearchHistoryResult
}
type SearchHistoryResult ¶
type SearchHistoryResult struct {
gorm.Model
SearchHistoryID uint
SearchHistory SearchHistory `gorm:"ONDELETE:CASCADE"`
ProductID uint
}
type Storage ¶
func NewStorage ¶
func (*Storage) AddItemToList ¶
func (*Storage) CreateFavoriteList ¶
func (storage *Storage) CreateFavoriteList(list *FavoriteList) error
func (*Storage) CreateSearchHistory ¶
func (storage *Storage) CreateSearchHistory(history *SearchHistory) error
func (*Storage) CreateSearchHistoryResult ¶
func (storage *Storage) CreateSearchHistoryResult(result *SearchHistoryResult) error
func (*Storage) CreateUnauthorizedToken ¶
func (storage *Storage) CreateUnauthorizedToken(token *UnauthorizedToken) error
func (*Storage) CreateUser ¶
func (storage *Storage) CreateUser(user *UserAccount) error
func (*Storage) DeleteUnauthorizedTokensBeforeNow ¶
func (*Storage) GetAllUnauthorizedTokens ¶
func (storage *Storage) GetAllUnauthorizedTokens() ([]*UnauthorizedToken, error)
func (*Storage) GetFavoriteListByID ¶
func (storage *Storage) GetFavoriteListByID(id uint) (*FavoriteList, error)
func (*Storage) GetFavoriteListByUserIDAndName ¶
func (storage *Storage) GetFavoriteListByUserIDAndName(userID uint, name string) (*FavoriteList, error)
func (*Storage) GetFavoriteListsByUserID ¶
func (storage *Storage) GetFavoriteListsByUserID(userID uint) (*[]FavoriteList, error)
func (*Storage) GetSearchHistoryByID ¶
func (storage *Storage) GetSearchHistoryByID(id uint) (*SearchHistory, error)
func (*Storage) GetSearchHistoryByUserID ¶
func (*Storage) GetUnauthorizedToken ¶
func (storage *Storage) GetUnauthorizedToken(token string) (*UnauthorizedToken, error)
func (*Storage) GetUserByEmail ¶
func (storage *Storage) GetUserByEmail(email string) (*UserAccount, error)
func (*Storage) GetUserByID ¶
func (storage *Storage) GetUserByID(id uint) (*UserAccount, error)
func (*Storage) GetUserByPhoneNumber ¶
func (storage *Storage) GetUserByPhoneNumber(phoneNumber string) (*UserAccount, error)
type UnauthorizedToken ¶
type UnauthorizedToken struct {
}
Click to show internal directories.
Click to hide internal directories.