Documentation ¶
Index ¶
- Constants
- Variables
- type Black
- type Conversation
- type Friend
- type FriendRequest
- type Group
- type GroupCount
- type GroupMember
- type GroupRequest
- type Log
- type MsgDataModel
- type MsgDocModel
- func (MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData)
- func (m MsgDocModel) GetDocID(conversationID string, seq int64) string
- func (m MsgDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[string][]int64
- func (MsgDocModel) GetMsgIndex(seq int64) int64
- func (MsgDocModel) GetSingleGocMsgNum() int64
- func (MsgDocModel) GetSingleGocMsgNum5000() int64
- func (m *MsgDocModel) IsFull() bool
- func (MsgDocModel) TableName() string
- type MsgInfoModel
- type Object
- type OfflinePushModel
- type RevokeModel
- type SeqConversation
- type SeqUser
- type SubscribeUser
- type User
- type UserCount
- type VersionLog
- type VersionLogElem
- type VersionLogTable
Constants ¶
View Source
const ( MsgTableName = "msg" OldestList = 0 NewestList = -1 )
View Source
const ( VersionStateInsert = iota + 1 VersionStateDelete VersionStateUpdate )
View Source
const ( VersionGroupChangeID = "" VersionSortChangeID = "____S_O_R_T_I_D____" )
View Source
const (
SubscribeUserTableName = "subscribe_user"
)
SubscribeUserTableName collection constant.
Variables ¶
View Source
var ErrMsgListNotExist = errs.New("user not have msg in mongoDB")
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct { OwnerUserID string `bson:"owner_user_id"` ConversationID string `bson:"conversation_id"` ConversationType int32 `bson:"conversation_type"` UserID string `bson:"user_id"` GroupID string `bson:"group_id"` RecvMsgOpt int32 `bson:"recv_msg_opt"` IsPinned bool `bson:"is_pinned"` IsPrivateChat bool `bson:"is_private_chat"` BurnDuration int32 `bson:"burn_duration"` GroupAtType int32 `bson:"group_at_type"` AttachedInfo string `bson:"attached_info"` Ex string `bson:"ex"` MaxSeq int64 `bson:"max_seq"` MinSeq int64 `bson:"min_seq"` CreateTime time.Time `bson:"create_time"` IsMsgDestruct bool `bson:"is_msg_destruct"` MsgDestructTime int64 `bson:"msg_destruct_time"` LatestMsgDestructTime time.Time `bson:"latest_msg_destruct_time"` }
type Friend ¶
type Friend struct { ID primitive.ObjectID `bson:"_id"` OwnerUserID string `bson:"owner_user_id"` FriendUserID string `bson:"friend_user_id"` Remark string `bson:"remark"` CreateTime time.Time `bson:"create_time"` AddSource int32 `bson:"add_source"` OperatorUserID string `bson:"operator_user_id"` Ex string `bson:"ex"` IsPinned bool `bson:"is_pinned"` }
Friend represents the data structure for a friend relationship in MongoDB.
type FriendRequest ¶
type FriendRequest struct { FromUserID string `bson:"from_user_id"` ToUserID string `bson:"to_user_id"` HandleResult int32 `bson:"handle_result"` ReqMsg string `bson:"req_msg"` CreateTime time.Time `bson:"create_time"` HandlerUserID string `bson:"handler_user_id"` HandleMsg string `bson:"handle_msg"` HandleTime time.Time `bson:"handle_time"` Ex string `bson:"ex"` }
type Group ¶
type Group struct { GroupID string `bson:"group_id"` GroupName string `bson:"group_name"` Notification string `bson:"notification"` Introduction string `bson:"introduction"` FaceURL string `bson:"face_url"` CreateTime time.Time `bson:"create_time"` Ex string `bson:"ex"` Status int32 `bson:"status"` CreatorUserID string `bson:"creator_user_id"` GroupType int32 `bson:"group_type"` NeedVerification int32 `bson:"need_verification"` LookMemberInfo int32 `bson:"look_member_info"` ApplyMemberFriend int32 `bson:"apply_member_friend"` NotificationUpdateTime time.Time `bson:"notification_update_time"` NotificationUserID string `bson:"notification_user_id"` }
type GroupCount ¶
type GroupMember ¶
type GroupMember struct { GroupID string `bson:"group_id"` UserID string `bson:"user_id"` Nickname string `bson:"nickname"` FaceURL string `bson:"face_url"` RoleLevel int32 `bson:"role_level"` JoinTime time.Time `bson:"join_time"` JoinSource int32 `bson:"join_source"` InviterUserID string `bson:"inviter_user_id"` OperatorUserID string `bson:"operator_user_id"` MuteEndTime time.Time `bson:"mute_end_time"` Ex string `bson:"ex"` }
type GroupRequest ¶
type GroupRequest struct { UserID string `bson:"user_id"` GroupID string `bson:"group_id"` HandleResult int32 `bson:"handle_result"` ReqMsg string `bson:"req_msg"` HandledMsg string `bson:"handled_msg"` ReqTime time.Time `bson:"req_time"` HandleUserID string `bson:"handle_user_id"` HandledTime time.Time `bson:"handled_time"` JoinSource int32 `bson:"join_source"` InviterUserID string `bson:"inviter_user_id"` Ex string `bson:"ex"` }
type Log ¶
type Log struct { LogID string `bson:"log_id"` Platform string `bson:"platform"` UserID string `bson:"user_id"` CreateTime time.Time `bson:"create_time"` Url string `bson:"url"` FileName string `bson:"file_name"` SystemType string `bson:"system_type"` Version string `bson:"version"` Ex string `bson:"ex"` }
type MsgDataModel ¶
type MsgDataModel struct { SendID string `bson:"send_id"` RecvID string `bson:"recv_id"` GroupID string `bson:"group_id"` ClientMsgID string `bson:"client_msg_id"` ServerMsgID string `bson:"server_msg_id"` SenderPlatformID int32 `bson:"sender_platform_id"` SenderNickname string `bson:"sender_nickname"` SenderFaceURL string `bson:"sender_face_url"` SessionType int32 `bson:"session_type"` MsgFrom int32 `bson:"msg_from"` ContentType int32 `bson:"content_type"` Content string `bson:"content"` Seq int64 `bson:"seq"` SendTime int64 `bson:"send_time"` CreateTime int64 `bson:"create_time"` Status int32 `bson:"status"` IsRead bool `bson:"is_read"` Options map[string]bool `bson:"options"` OfflinePush *OfflinePushModel `bson:"offline_push"` AtUserIDList []string `bson:"at_user_id_list"` AttachedInfo string `bson:"attached_info"` Ex string `bson:"ex"` }
type MsgDocModel ¶
type MsgDocModel struct { DocID string `bson:"doc_id"` Msg []*MsgInfoModel `bson:"msgs"` }
func (MsgDocModel) GenExceptionMessageBySeqs ¶
func (MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData)
func (MsgDocModel) GetDocID ¶
func (m MsgDocModel) GetDocID(conversationID string, seq int64) string
func (MsgDocModel) GetDocIDSeqsMap ¶
func (m MsgDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[string][]int64
func (MsgDocModel) GetMsgIndex ¶
func (MsgDocModel) GetMsgIndex(seq int64) int64
func (MsgDocModel) GetSingleGocMsgNum ¶
func (MsgDocModel) GetSingleGocMsgNum() int64
func (MsgDocModel) GetSingleGocMsgNum5000 ¶
func (MsgDocModel) GetSingleGocMsgNum5000() int64
func (*MsgDocModel) IsFull ¶
func (m *MsgDocModel) IsFull() bool
func (MsgDocModel) TableName ¶
func (MsgDocModel) TableName() string
type MsgInfoModel ¶
type MsgInfoModel struct { Msg *MsgDataModel `bson:"msg"` Revoke *RevokeModel `bson:"revoke"` DelList []string `bson:"del_list"` IsRead bool `bson:"is_read"` }
type OfflinePushModel ¶
type RevokeModel ¶
type SeqConversation ¶
type SubscribeUser ¶
type SubscribeUser struct { UserID string `bson:"user_id" json:"userID"` UserIDList []string `bson:"user_id_list" json:"userIDList"` }
SubscribeUser collection structure.
func (SubscribeUser) TableName ¶
func (SubscribeUser) TableName() string
type User ¶
type User struct { UserID string `bson:"user_id"` Nickname string `bson:"nickname"` FaceURL string `bson:"face_url"` Ex string `bson:"ex"` AppMangerLevel int32 `bson:"app_manger_level"` GlobalRecvMsgOpt int32 `bson:"global_recv_msg_opt"` CreateTime time.Time `bson:"create_time"` }
func (*User) GetFaceURL ¶
func (*User) GetNickname ¶
type VersionLog ¶
type VersionLog struct { ID primitive.ObjectID `bson:"_id"` DID string `bson:"d_id"` Logs []VersionLogElem `bson:"logs"` Version uint `bson:"version"` Deleted uint `bson:"deleted"` LastUpdate time.Time `bson:"last_update"` LogLen int `bson:"log_len"` }
func (*VersionLog) DeleteAndChangeIDs ¶
func (v *VersionLog) DeleteAndChangeIDs() (insertIds, deleteIds, updateIds []string)
type VersionLogElem ¶
type VersionLogTable ¶
type VersionLogTable struct { ID primitive.ObjectID `bson:"_id"` DID string `bson:"d_id"` Logs []VersionLogElem `bson:"logs"` Version uint `bson:"version"` Deleted uint `bson:"deleted"` LastUpdate time.Time `bson:"last_update"` }
func (*VersionLogTable) VersionLog ¶
func (v *VersionLogTable) VersionLog() *VersionLog
Click to show internal directories.
Click to hide internal directories.