convert

package
v3.8.2-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlackDB2Pb

func BlackDB2Pb(ctx context.Context, blackDBs []*model.Black, f func(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error)) (blackPbs []*sdk.BlackInfo, err error)

func ConversationDB2Pb

func ConversationDB2Pb(conversationDB *model.Conversation) *conversation.Conversation

func ConversationPb2DB

func ConversationPb2DB(conversationPB *conversation.Conversation) *model.Conversation

func ConversationsDB2Pb

func ConversationsDB2Pb(conversationsDB []*model.Conversation) (conversationsPB []*conversation.Conversation)

func ConversationsPb2DB

func ConversationsPb2DB(conversationsPB []*conversation.Conversation) (conversationsDB []*model.Conversation)

func Db2PbCMSGroup

func Db2PbCMSGroup(m *model.Group, ownerUserID string, ownerUserName string, memberCount uint32) *pbgroup.CMSGroup

func Db2PbGroupAbstractInfo

func Db2PbGroupAbstractInfo(
	groupID string,
	groupMemberNumber uint32,
	groupMemberListHash uint64,
) *pbgroup.GroupAbstractInfo

func Db2PbGroupInfo

func Db2PbGroupInfo(m *model.Group, ownerUserID string, memberCount uint32) *sdkws.GroupInfo

func Db2PbGroupMember

func Db2PbGroupMember(m *model.GroupMember) *sdkws.GroupMemberFullInfo

func Db2PbGroupRequest

func Db2PbGroupRequest(m *model.GroupRequest, user *sdkws.PublicUserInfo, group *sdkws.GroupInfo) *sdkws.GroupRequest

func FriendDB2Pb

func FriendDB2Pb(ctx context.Context, friendDB *model.Friend,
	getUsers func(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error),
) (*sdkws.FriendInfo, error)

func FriendPb2DB

func FriendPb2DB(friend *sdkws.FriendInfo) *model.Friend

func FriendPb2DBMap added in v3.4.2

func FriendPb2DBMap(friend *sdkws.FriendInfo) map[string]any

FriendPb2DBMap converts a FriendInfo protobuf object to a map suitable for database operations. It only includes non-zero or non-empty fields in the map.

func FriendRequestDB2Pb

func FriendRequestDB2Pb(ctx context.Context, friendRequests []*model.FriendRequest, getUsers func(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error)) ([]*sdkws.FriendRequest, error)

func FriendsDB2Pb

func FriendsDB2Pb(
	ctx context.Context,
	friendsDB []*model.Friend,
	getUsers func(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error),
) (friendsPb []*sdkws.FriendInfo, err error)

func MsgDB2Pb

func MsgDB2Pb(msgModel *model.MsgDataModel) *sdkws.MsgData

func MsgPb2DB

func MsgPb2DB(msg *sdkws.MsgData) *model.MsgDataModel

func Pb2DBGroupInfo

func Pb2DBGroupInfo(m *sdkws.GroupInfo) *model.Group

func Pb2DbGroupRequest

func Pb2DbGroupRequest(req *pbgroup.GroupApplicationResponseReq, handleUserID string) *model.GroupRequest

func UserDB2Pb added in v3.8.0

func UserDB2Pb(user *relationtb.User) *sdkws.UserInfo

func UserPb2DB

func UserPb2DB(user *sdkws.UserInfo) *relationtb.User

func UserPb2DBMap added in v3.4.2

func UserPb2DBMap(user *sdkws.UserInfo) map[string]any

func UserPb2DBMapEx added in v3.5.0

func UserPb2DBMapEx(user *sdkws.UserInfoWithEx) map[string]any

func UsersDB2Pb

func UsersDB2Pb(users []*relationtb.User) []*sdkws.UserInfo

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL