Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPmDeleted = errors.New("private message deleted")
View Source
var ErrPmInvalidOperation = errors.New("invalid operation")
View Source
var ErrPmNotOwned = errors.New("not sent or received this private message")
View Source
var ErrPmRelatedNotExists = errors.New("related private message not exists")
View Source
var ErrPmUserIrrelevant = errors.New("has user irrelevant message")
Functions ¶
This section is empty.
Types ¶
type FolderType ¶ added in v0.30.3
type FolderType string
const ( FolderTypeInbox FolderType = "inbox" FolderTypeOutbox FolderType = "outbox" )
type PrivateMessage ¶ added in v0.30.3
type PrivateMessage struct { CreatedTime time.Time Title string Content string Folder FolderType SenderID model.UserID ReceiverID model.UserID ID model.PrivateMessageID MainMessageID model.PrivateMessageID // 如果当前是首条私信,则为当前私信的id,否则为0 RelatedMessageID model.PrivateMessageID // 首条私信的id New bool DeletedBySender bool DeletedByReceiver bool }
type PrivateMessageListItem ¶ added in v0.30.3
type PrivateMessageListItem struct { Main PrivateMessage Self PrivateMessage }
type PrivateMessageTypeCounts ¶ added in v0.30.3
type Repo ¶ added in v0.30.3
type Repo interface { List( ctx context.Context, userID model.UserID, folder FolderType, offset int, limit int, ) ([]PrivateMessageListItem, error) CountByFolder( ctx context.Context, userID model.UserID, folder FolderType, ) (int64, error) ListRelated( ctx context.Context, userID model.UserID, id model.PrivateMessageID, ) ([]PrivateMessage, error) CountTypes(ctx context.Context, userID model.UserID) (PrivateMessageTypeCounts, error) MarkRead(ctx context.Context, userID model.UserID, relatedID model.PrivateMessageID) error ListRecentContact(ctx context.Context, userID model.UserID) ([]model.UserID, error) Create( ctx context.Context, senderID model.UserID, receiverIDs []model.UserID, relatedIDFilter IDFilter, title string, content string, ) ([]PrivateMessage, error) Delete( ctx context.Context, userID model.UserID, ids []model.PrivateMessageID, ) error }
Click to show internal directories.
Click to hide internal directories.