Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { ID string `json:"id" db:"id"` ParentID sql.NullString `json:"parent_id" db:"parent_id"` UserID string `json:"user_id" db:"user_id"` Text string `json:"text" db:"text"` AttachmentID string `json:"attachment_id" db:"attachment_id"` AttachmentType string `json:"attachment_type" db:"attachment_type"` AttachmentThumbnailID string `json:"attachment_thumbnail_id" db:"attachment_thumbnail_id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Likes int `json:"likes" db:"likes"` LikedByMe bool `json:"liked_by_me" db:"liked_by_me"` GroupID sql.NullString `json:"group_id" db:"group_id"` IsGuest bool `json:"is_guest" db:"is_guest"` FriendID sql.NullString `json:"friend_id" db:"friend_id"` IsPublic bool `json:"is_public" db:"is_public"` }
type MessageLike ¶
type MessageRepo ¶
type MessageRepo interface { Messages(currentUserID string, userIDs []string, from time.Time, count int) []Message PublicMessages(userID string, from time.Time, count int) []Message GroupMessages(currentUserID, groupID string, from time.Time, count int) []Message DirectMessages(currentUserID, friendID string, from time.Time, count int) []Message Message(currentUserID string, messageID string) *Message PublicMessage(messageID string) *Message AddMessage(parentID string, message Message) EditMessageText(userID, messageID, text string, updatedAt time.Time) bool EditMessageAttachment(userID, messageID, attachmentID, attachmentType, attachmentThumbnailID string, updatedAt time.Time) bool DeleteMessage(messageID string) bool Comments(currentUserID string, messageIDs []string) map[string][]Message LikeMessage(userID, messageID string) int UnlikeMessage(userID, messageID string) int MessagesLikes(messageIDs []string) map[string][]MessageLike MessageLikes(messageID string) []MessageLike SetMessageVisibility(userID, messageID string, visibility bool) ReportMessage(userID, messageID, report string) string MessageReport(reportID string) *MessageReport MessageReports() []MessageReport DeleteReportedMessage(reportID string) bool BlockReportedUser(reportID string) bool ResolveMessageReport(reportID string) bool DeleteExpiredMessages(until time.Time, onlyGuestMessages bool) MarkRead(userID string, messageIDs []string) Counts(currentUserID string, userIDs []string) Counts GroupCounts(currentUserID string, groupIDs []string) map[string]Counts DirectCounts(currentUserID string) map[string]*Counts DeleteUserData(tx *sqlx.Tx, userID string) error }
func NewMessages ¶
func NewMessages(db *sqlx.DB) MessageRepo
type MessageReport ¶
type MessageReport struct { ID string `json:"id" db:"id"` ReportedByID string `json:"reported_by" db:"reported_by"` Report string `json:"report" db:"report"` CreatedAt time.Time `json:"created_at" db:"created_at"` ResolvedAt sql.NullTime `json:"resolved_at" db:"resolved_at"` MessageID string `json:"message_id" db:"message_id"` AuthorID string `json:"author_id" db:"author_id"` Text string `json:"text" db:"text"` AttachmentType string `json:"attachment_type" db:"attachment_type"` AttachmentID string `json:"attachment_id" db:"attachment_id"` AttachmentThumbnailID string `json:"attachment_thumbnail_id" db:"attachment_thumbnail_id"` }
type Repos ¶
type Repos struct { Message MessageRepo Notification common.NotificationRepo User UserRepo Setting common.SettingRepo // contains filtered or unexported fields }
func (Repos) DeleteUserData ¶
Click to show internal directories.
Click to hide internal directories.