Documentation ¶
Index ¶
- Variables
- type DbConfig
- func (dbCfg *DbConfig) DeleteSpecificToplistItems(itemsToDelete []ToplistItem) error
- func (dbCfg *DbConfig) DeleteToplist(listId int) error
- func (dbCfg *DbConfig) DeleteToplistItems(listId int) error
- func (dbCfg *DbConfig) DeleteUser(userID int) error
- func (dbCfg *DbConfig) GetToplist(listId int) (Toplist, error)
- func (dbCfg *DbConfig) GetToplistItems(listId int) ([]ToplistItem, error)
- func (dbCfg *DbConfig) GetToplistLikes(toplistID int) ([]int, error)
- func (dbCfg *DbConfig) GetUserByEmail(email string) (User, error)
- func (dbCfg *DbConfig) GetUserByID(userID int) (User, error)
- func (dbCfg *DbConfig) InsertPasswordResetToken(user User) error
- func (dbCfg *DbConfig) InsertToplist(toplist Toplist) (Toplist, error)
- func (dbCfg *DbConfig) InsertToplistItems(toplistItems []ToplistItem, listId int) ([]ToplistItem, error)
- func (dbCfg *DbConfig) InsertUser(user User) (User, error)
- func (dbCfg *DbConfig) IsTokenRevoked(token string) (bool, error)
- func (dbCfg *DbConfig) ListToplists(limit, offset int) ([]Toplist, error)
- func (dbCfg *DbConfig) ListToplistsByProperty(limit int, property string) ([]Toplist, error)
- func (dbCfg *DbConfig) ListToplistsByUser(userID, limit, offset int) ([]Toplist, error)
- func (dbCfg *DbConfig) ResetPassword(newPasswordHash, resetToken string) error
- func (dbCfg *DbConfig) RevokeToken(token string) (Revocation, error)
- func (dbCfg *DbConfig) SearchToplists(searchTerm string, limit, offset int) ([]Toplist, error)
- func (dbCfg *DbConfig) UpdateToplist(toplist Toplist) (Toplist, error)
- func (dbCfg *DbConfig) UpdateToplistItems(newListItems []ToplistItem, listId int) ([]ToplistItem, error)
- func (dbCfg *DbConfig) UpdateToplistLikes(toplistID, userID int) error
- func (dbCfg *DbConfig) UpdateToplistViews(toplistID int) (Toplist, error)
- func (dbCfg *DbConfig) UpdateUserEmail(userID int, email string) (User, error)
- func (dbCfg *DbConfig) UpdateUserPassword(userID int, hashedPassword string) (User, error)
- func (dbCfg *DbConfig) UpdateUserUsername(userID int, username string) (User, error)
- func (dbCfg *DbConfig) UserWithEmailExists(email string) (bool, error)
- func (dbCfg *DbConfig) UserWithUsernameExists(username string) (bool, error)
- type Revocation
- type Toplist
- type ToplistItem
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExist = errors.New("already exists")
View Source
var ErrIsExpired = errors.New("already expired")
View Source
var ErrNotExist = errors.New("resource does not exist")
Functions ¶
This section is empty.
Types ¶
type DbConfig ¶
type DbConfig struct {
// contains filtered or unexported fields
}
func (*DbConfig) DeleteSpecificToplistItems ¶
func (dbCfg *DbConfig) DeleteSpecificToplistItems(itemsToDelete []ToplistItem) error
func (*DbConfig) DeleteToplist ¶
func (*DbConfig) DeleteToplistItems ¶
func (*DbConfig) DeleteUser ¶
func (*DbConfig) GetToplistItems ¶
func (dbCfg *DbConfig) GetToplistItems(listId int) ([]ToplistItem, error)
func (*DbConfig) GetToplistLikes ¶
func (*DbConfig) InsertPasswordResetToken ¶
func (*DbConfig) InsertToplist ¶
func (*DbConfig) InsertToplistItems ¶
func (dbCfg *DbConfig) InsertToplistItems(toplistItems []ToplistItem, listId int) ([]ToplistItem, error)
func (*DbConfig) ListToplists ¶
func (*DbConfig) ListToplistsByProperty ¶
func (*DbConfig) ListToplistsByUser ¶
func (*DbConfig) ResetPassword ¶
func (*DbConfig) RevokeToken ¶
func (dbCfg *DbConfig) RevokeToken(token string) (Revocation, error)
func (*DbConfig) SearchToplists ¶
func (*DbConfig) UpdateToplist ¶
func (*DbConfig) UpdateToplistItems ¶
func (dbCfg *DbConfig) UpdateToplistItems(newListItems []ToplistItem, listId int) ([]ToplistItem, error)
func (*DbConfig) UpdateToplistLikes ¶
func (*DbConfig) UpdateToplistViews ¶
func (*DbConfig) UpdateUserEmail ¶
func (*DbConfig) UpdateUserPassword ¶
func (*DbConfig) UpdateUserUsername ¶
func (*DbConfig) UserWithEmailExists ¶
type Revocation ¶
type Toplist ¶
type Toplist struct { ToplistID int `json:"toplist_id"` Title string `json:"title"` Description string `json:"description"` UserID int `json:"user_id"` Username string `json:"username"` CreatedAt time.Time `json:"created_at"` Items []ToplistItem `json:"items"` Views int `json:"views"` LikeCount int `json:"like_count"` LikeIDs []int `json:"like_ids"` }
type ToplistItem ¶
type User ¶
type User struct { ID int `json:"id"` Email string `json:"email"` HashedPassword string `json:"hashed_password"` CreatedAt time.Time `json:"created_at"` PasswordResetToken string `json:"password_reset_token"` PasswordResetTokenExpireAt time.Time `json:"password_reset_token_expire_at"` Username string `json:"username"` }
Click to show internal directories.
Click to hide internal directories.