Documentation ¶
Index ¶
- func Close()
- func CreateUser(fullname, username, passwordHash string) error
- func CreateUserSession(userId uint64, sessionId string) error
- func DeleteFriendRequest(from, to uint64) error
- func DeleteFriendship(userId1, userId2 uint64) error
- func DeleteUserSession(sessionId string) error
- func GetConversationsOf(userId uint64) ([]models.Conversation, error)
- func GetFriendRequestorsTo(userId uint64) ([]models.User, error)
- func GetFriends(userId uint64) ([]models.User, error)
- func GetFriendshipStatus(userId, otherUserId uint64) (string, error)
- func GetMessagesAmong(userId1, userId2 uint64) ([]models.Message, error)
- func GetRecentChatPartners(userId uint64) ([]models.User, error)
- func GetSession(sessionId string) (*models.Session, error)
- func GetUserById(id uint64) (*models.User, error)
- func GetUserBySessionId(sessionId string) (*models.User, error)
- func GetUserByUsername(username string) (*models.User, error)
- func IsUsernameTaken(username string) (bool, error)
- func MustInit()
- func RecordFriendRequest(from, to uint64) error
- func RecordFriendship(userId1, userId2 uint64) error
- func RecordMessage(senderId, receiverId uint64, text string, timestamp time.Time) (uint64, error)
- func SearchUser(searchType, searchQuery string) ([]models.User, error)
- func UpdateOrCreateConversation(senderId, receiverId uint64, timestamp time.Time) error
- func UpdateUser(userId uint64, newUser models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func CreateUserSession ¶
func DeleteFriendRequest ¶
func DeleteFriendship ¶
func DeleteUserSession ¶
func GetConversationsOf ¶
func GetConversationsOf(userId uint64) ([]models.Conversation, error)
func GetFriendRequestorsTo ¶
Returns list of users that have sent request to given user
func GetFriends ¶
Returns list of users that are friends to user with given id
func GetFriendshipStatus ¶
Returns status of friendship for two users from first user's point of view. Can give 4 statuses, "friends", "req-sent", "req-received", "unknown". Ex. "req-sent" means first user has sent a request to second.
func IsUsernameTaken ¶
func RecordFriendRequest ¶
func RecordFriendship ¶
func RecordMessage ¶
func UpdateOrCreateConversation ¶
Updates an exsiting conversation's timestamp between two users or creates a new one
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.