user

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerUserToLocalUser

func ServerUserToLocalUser(user *sdkws.UserInfo) *model_struct.LocalUser

Types

type BasicInfo

type BasicInfo struct {
	Nickname string
	FaceURL  string
}

type User

type User struct {
	db_interface.DataBase

	UserBasicCache    *cache.Cache[string, *BasicInfo]
	OnlineStatusCache *cache.Cache[string, *userPb.OnlineStatus]
	// contains filtered or unexported fields
}

User is a struct that represents a user in the system.

func NewUser

func NewUser(dataBase db_interface.DataBase, loginUserID string, conversationCh chan common.Cmd2Value) *User

NewUser creates a new User object.

func (*User) DoNotification

func (u *User) DoNotification(ctx context.Context, msg *sdkws.MsgData)

DoNotification handles incoming notifications for the user.

func (*User) GetSelfUserInfo

func (u *User) GetSelfUserInfo(ctx context.Context) (*model_struct.LocalUser, error)

func (*User) GetServerUserInfo

func (u *User) GetServerUserInfo(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error)

GetServerUserInfo retrieves user information from the server.

func (*User) GetSingleUserFromSvr

func (u *User) GetSingleUserFromSvr(ctx context.Context, userID string) (*model_struct.LocalUser, error)

GetSingleUserFromSvr retrieves user information from the server.

func (*User) GetSubscribeUsersStatus

func (u *User) GetSubscribeUsersStatus(ctx context.Context) ([]*userPb.OnlineStatus, error)

func (*User) GetUserStatus

func (u *User) GetUserStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error)

func (*User) GetUsersInfo

func (u *User) GetUsersInfo(ctx context.Context, userIDs []string) ([]*model_struct.LocalUser, error)

func (*User) GetUsersInfoFromSvr

func (u *User) GetUsersInfoFromSvr(ctx context.Context, userIDs []string) ([]*model_struct.LocalUser, error)

GetUsersInfoFromSvr retrieves user information from the server.

func (*User) ParseTokenFromSvr

func (u *User) ParseTokenFromSvr(ctx context.Context) (int64, error)

ParseTokenFromSvr parses a token from the server.

func (*User) SetGlobalRecvMessageOpt

func (u *User) SetGlobalRecvMessageOpt(ctx context.Context, opt int) error

func (*User) SetListener

func (u *User) SetListener(listener func() open_im_sdk_callback.OnUserListener)

SetListener sets the user's listener.

func (*User) SetSelfInfo

func (u *User) SetSelfInfo(ctx context.Context, userInfo *sdkws.UserInfoWithEx) error

func (*User) SubscribeUsersStatus

func (u *User) SubscribeUsersStatus(ctx context.Context, userIDs []string) ([]*userPb.OnlineStatus, error)

func (*User) SyncLoginUserInfo

func (u *User) SyncLoginUserInfo(ctx context.Context) error

func (*User) SyncUserStatus

func (u *User) SyncUserStatus(ctx context.Context, fromUserID string, status int32, platformID int32)

func (*User) UnsubscribeUsersStatus

func (u *User) UnsubscribeUsersStatus(ctx context.Context, userIDs []string) error

func (*User) UpdateMsgSenderInfo

func (u *User) UpdateMsgSenderInfo(ctx context.Context, nickname, faceURL string) (err error)

Jump to

Keyboard shortcuts

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