user

package
v3.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalUserToPublicUser added in v3.8.1

func LocalUserToPublicUser(user *model_struct.LocalUser) *sdk_struct.PublicUser

func ServerCommandToLocalCommand added in v3.8.0

func ServerCommandToLocalCommand(data *user.AllCommandInfoResp) *model_struct.LocalUserCommand

func ServerUserToLocalUser

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

Types

type User

type User struct {
	db_interface.DataBase

	UserCache *cache.UserCache[string, *model_struct.LocalUser]
	// 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) GetSingleUserFromServer added in v3.8.2

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

GetSingleUserFromServer retrieves user information from the server.

func (*User) GetUserInfoWithCache added in v3.8.1

func (u *User) GetUserInfoWithCache(ctx context.Context, cacheKey string) (*model_struct.LocalUser, error)

func (*User) GetUsersInfo

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

func (*User) GetUsersInfoFromServer added in v3.8.2

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

GetUsersInfoFromServer retrieves user information from the server.

func (*User) GetUsersInfoWithCache added in v3.8.1

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

func (*User) ProcessUserCommandAdd added in v3.8.0

func (u *User) ProcessUserCommandAdd(ctx context.Context, userCommand *userPb.ProcessUserCommandAddReq) error

ProcessUserCommandAdd CRUD user command

func (*User) ProcessUserCommandDelete added in v3.8.0

func (u *User) ProcessUserCommandDelete(ctx context.Context, userCommand *userPb.ProcessUserCommandDeleteReq) error

ProcessUserCommandDelete delete user's choice

func (*User) ProcessUserCommandGetAll added in v3.8.0

func (u *User) ProcessUserCommandGetAll(ctx context.Context) ([]*userPb.CommandInfoResp, error)

ProcessUserCommandGetAll get user's choice

func (*User) ProcessUserCommandUpdate added in v3.8.0

func (u *User) ProcessUserCommandUpdate(ctx context.Context, userCommand *userPb.ProcessUserCommandUpdateReq) error

ProcessUserCommandUpdate update user's choice

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) SyncAllCommand added in v3.8.0

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

func (*User) SyncAllCommandWithoutNotice added in v3.8.0

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

func (*User) SyncLoginUserInfo

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

func (*User) SyncLoginUserInfoWithoutNotice added in v3.8.0

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

func (*User) UserOnlineStatusChange added in v3.8.0

func (u *User) UserOnlineStatusChange(users map[string][]int32)

Jump to

Keyboard shortcuts

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