Documentation
¶
Index ¶
- Variables
- type BlockedUserDTO
- type Channel
- type ChannelMember
- type ChannelModel
- func (m *ChannelModel) AddMember()
- func (m *ChannelModel) ChangeAdminPerms()
- func (m *ChannelModel) ChangeChannelHiddenState()
- func (m *ChannelModel) CreateChannel()
- func (m *ChannelModel) DeleteChannel()
- func (m *ChannelModel) FetchChannel()
- func (m *ChannelModel) FetchChannels()
- func (m *ChannelModel) FetchMembers()
- func (m *ChannelModel) RemoveMember()
- type NewSession
- type NullString
- type PublicUserDTO
- type Relationship
- type RelationshipModel
- func (m *RelationshipModel) BlockUser(userA, userB string) error
- func (m *RelationshipModel) DeleteRelationship(userA, userB string) error
- func (m *RelationshipModel) FetchBlockedUsers(userID string) ([]BlockedUserDTO, error)
- func (m *RelationshipModel) FetchFriendRequests(userID string) ([]RelationshipUserDTO, error)
- func (m *RelationshipModel) FetchFriends(userID string) ([]RelationshipUserDTO, error)
- func (m *RelationshipModel) SetRelationship(userA, userB string) (string, error)
- type RelationshipUserDTO
- type Session
- type SessionsModel
- func (m *SessionsModel) DeleteAllSessions(userID string) error
- func (m *SessionsModel) DeleteSession(sessionID string) error
- func (m *SessionsModel) NewSession(userID, platform, os, ip string) (NewSession, error)
- func (m *SessionsModel) RevalidateSession(sessionID string, refreshToken string) (NewSession, error)
- type User
- type UserDTO
- type UserModel
- func (m *UserModel) Authenticate(email, password string) (string, error)
- func (m *UserModel) FetchUser(userID string) (UserDTO, error)
- func (m *UserModel) FetchUsersByUsername(username string) ([]PublicUserDTO, error)
- func (m *UserModel) InsertUser(username, email, password string) (string, error)
- func (m *UserModel) UpdatePassword(userID, oldPassword, newPassword string) error
- func (m *UserModel) UpdateProfileInfo(userID, displayName, bio string) (UserDTO, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateEmail = errors.New("models: duplicate email")
View Source
var ErrDuplicateUsername = errors.New("models: duplicate username")
View Source
var ErrInvalidCredentials = errors.New("models: invalid credentials")
View Source
var ErrInvalidSession = errors.New("models: session token is invalid")
View Source
var ErrMaxFriends = errors.New("models: the user has reached the maximum number of friends")
View Source
var ErrNoSessionsFound = errors.New("models: no sessions matching the specified token or id where found")
View Source
var ErrNothingToUpdate = errors.New("models: nothing to update")
View Source
var ErrRecipientHasBlockedUser = errors.New("models: the recipient has blocked the client user")
View Source
var ErrRelationshipExists = errors.New("models: the users are already friends")
View Source
var ErrSameUser = errors.New("models: the user IDs are the same")
View Source
var ErrSessionExpired = errors.New("models: the session has expired")
View Source
var ErrUserNotFound = errors.New("models: user not found")
View Source
var RefreshTokenExpirationDelta time.Duration = time.Hour * 24 * 30
Functions ¶
This section is empty.
Types ¶
type BlockedUserDTO ¶
type BlockedUserDTO struct { UserID string `json:"userID"` Username string `json:"username"` DisplayName NullString `json:"displayName"` ProfilePictureURL NullString `json:"profilePictureURL"` }
type ChannelMember ¶
type ChannelModel ¶
func (*ChannelModel) AddMember ¶
func (m *ChannelModel) AddMember()
func (*ChannelModel) ChangeAdminPerms ¶
func (m *ChannelModel) ChangeAdminPerms()
func (*ChannelModel) ChangeChannelHiddenState ¶
func (m *ChannelModel) ChangeChannelHiddenState()
func (*ChannelModel) CreateChannel ¶
func (m *ChannelModel) CreateChannel()
func (*ChannelModel) DeleteChannel ¶
func (m *ChannelModel) DeleteChannel()
func (*ChannelModel) FetchChannel ¶
func (m *ChannelModel) FetchChannel()
func (*ChannelModel) FetchChannels ¶
func (m *ChannelModel) FetchChannels()
func (*ChannelModel) FetchMembers ¶
func (m *ChannelModel) FetchMembers()
func (*ChannelModel) RemoveMember ¶
func (m *ChannelModel) RemoveMember()
type NewSession ¶
type NullString ¶
type NullString string
func (*NullString) Scan ¶
func (ns *NullString) Scan(value interface{}) error
type PublicUserDTO ¶
type PublicUserDTO struct { UserID string `json:"userID"` Username string `json:"username"` DisplayName NullString `json:"displayName"` JoinedAt time.Time `json:"joinedAt"` CustomStatus NullString `json:"customStatus"` Bio NullString `json:"bio"` ProfilePictureURL NullString `json:"profilePictureURL"` }
type Relationship ¶
type RelationshipModel ¶
func (*RelationshipModel) BlockUser ¶
func (m *RelationshipModel) BlockUser(userA, userB string) error
func (*RelationshipModel) DeleteRelationship ¶
func (m *RelationshipModel) DeleteRelationship(userA, userB string) error
func (*RelationshipModel) FetchBlockedUsers ¶
func (m *RelationshipModel) FetchBlockedUsers(userID string) ([]BlockedUserDTO, error)
func (*RelationshipModel) FetchFriendRequests ¶
func (m *RelationshipModel) FetchFriendRequests(userID string) ([]RelationshipUserDTO, error)
func (*RelationshipModel) FetchFriends ¶
func (m *RelationshipModel) FetchFriends(userID string) ([]RelationshipUserDTO, error)
func (*RelationshipModel) SetRelationship ¶
func (m *RelationshipModel) SetRelationship(userA, userB string) (string, error)
type RelationshipUserDTO ¶
type RelationshipUserDTO struct { UserID string `json:"userID"` Username string `json:"username"` DisplayName NullString `json:"displayName"` ProfilePictureURL NullString `json:"profilePictureURL"` Status string `json:"status"` }
type SessionsModel ¶
func (*SessionsModel) DeleteAllSessions ¶
func (m *SessionsModel) DeleteAllSessions(userID string) error
func (*SessionsModel) DeleteSession ¶
func (m *SessionsModel) DeleteSession(sessionID string) error
func (*SessionsModel) NewSession ¶
func (m *SessionsModel) NewSession(userID, platform, os, ip string) (NewSession, error)
func (*SessionsModel) RevalidateSession ¶
func (m *SessionsModel) RevalidateSession(sessionID string, refreshToken string) (NewSession, error)
type User ¶
type User struct { UserID string Username string DisplayName NullString Email string Password string JoinedAt time.Time UpdatedAt time.Time Verified bool CustomStatus NullString ProfilePictureURL NullString Bio NullString }
type UserDTO ¶
type UserDTO struct { UserID string `json:"userID"` Username string `json:"username"` DisplayName NullString `json:"displayName"` Email string `json:"email"` JoinedAt time.Time `json:"joinedAt"` UpdatedAt time.Time `json:"updatedAt"` CustomStatus NullString `json:"customStatus"` ProfilePictureURL NullString `json:"profilePictureURL"` Bio NullString `json:"bio"` }
type UserModel ¶
func (*UserModel) Authenticate ¶
func (*UserModel) FetchUsersByUsername ¶
func (m *UserModel) FetchUsersByUsername(username string) ([]PublicUserDTO, error)
func (*UserModel) InsertUser ¶
func (*UserModel) UpdatePassword ¶
Click to show internal directories.
Click to hide internal directories.