Documentation ¶
Index ¶
- type ChatRepo
- func (r *ChatRepo) Create(chat *models.Chat) error
- func (r *ChatRepo) Delete(chat *models.Chat) error
- func (r *ChatRepo) FindByID(id int) (*models.Chat, error)
- func (r *ChatRepo) FindByUserID(id int) (*[]models.Chat, error)
- func (r *ChatRepo) FindPrivateChatByUsersArray(users []*models.User) (*models.Chat, error)
- func (r *ChatRepo) Update(chat *models.Chat) error
- type MessageRepo
- func (r *MessageRepo) Create(message *models.Message) error
- func (r *MessageRepo) FindAll() (*[]models.Message, error)
- func (r *MessageRepo) FindByID(id int) (*models.Message, error)
- func (r *MessageRepo) GetMessages(chatID, from, limit int) (*[]models.Message, error)
- func (r *MessageRepo) Update(message *models.Message) error
- type UserRepo
- func (r *UserRepo) Create(user *models.User) error
- func (r *UserRepo) Delete(user *models.User) error
- func (r *UserRepo) FindAll() (*[]models.User, error)
- func (r *UserRepo) FindArrayByPartUsername(username string, order string, limit int) (*[]models.User, error)
- func (r *UserRepo) FindByID(id int) (*models.User, error)
- func (r *UserRepo) FindByUsername(username string) (*models.User, error)
- func (r *UserRepo) PasswordMatches(user *models.User, plainText string) (bool, error)
- func (r *UserRepo) ReplaceBlockedUsers(user *models.User, blockedUsers []*models.User) error
- func (r *UserRepo) ReplaceFollowedUsers(user *models.User, followedUsers []*models.User) error
- func (r *UserRepo) ResetPassword(user *models.User, password string) error
- func (r *UserRepo) Update(user *models.User) error
- func (r *UserRepo) UpdateWithAssociations(user *models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRepo ¶
type ChatRepo struct {
// contains filtered or unexported fields
}
func NewChatRepo ¶
func (*ChatRepo) FindPrivateChatByUsersArray ¶
type MessageRepo ¶
type MessageRepo struct {
// contains filtered or unexported fields
}
func NewMessageRepo ¶
func NewMessageRepo(db *gorm.DB) *MessageRepo
func (*MessageRepo) GetMessages ¶
func (r *MessageRepo) GetMessages(chatID, from, limit int) (*[]models.Message, error)
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) FindArrayByPartUsername ¶
func (*UserRepo) FindByUsername ¶
func (*UserRepo) PasswordMatches ¶
PasswordMatches uses Go's bcrypt package to compare a user supplied password with the hash we have stored for a given user in the database. If the password and hash match, we return true; otherwise, we return false.
func (*UserRepo) ReplaceBlockedUsers ¶
func (*UserRepo) ReplaceFollowedUsers ¶
func (*UserRepo) ResetPassword ¶
ResetPassword is the method we will use to change a user's password.
Click to show internal directories.
Click to hide internal directories.