manager

package
v3.8.3-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaManager

type MetaManager struct {
	sdk_struct.IMConfig
	// contains filtered or unexported fields
}

func NewMetaManager

func NewMetaManager() *MetaManager

func (*MetaManager) ApiPost

func (m *MetaManager) ApiPost(ctx context.Context, route string, req, resp any) (err error)

func (*MetaManager) BuildCtx

func (m *MetaManager) BuildCtx(ctx context.Context) context.Context

BuildCtx build an admin token

func (*MetaManager) GetAdminToken added in v3.8.2

func (m *MetaManager) GetAdminToken(userID string, platformID int32) (string, error)

func (*MetaManager) GetSecret

func (m *MetaManager) GetSecret() string

func (*MetaManager) GetUserToken added in v3.8.2

func (m *MetaManager) GetUserToken(userID string, platformID int32) (string, error)

func (*MetaManager) PostWithCtx

func (m *MetaManager) PostWithCtx(route string, req, resp any) error

PostWithCtx should only be used for scenarios such as registration and login that do not require a token or require an admin token. For scenarios that require a specific user token, please obtain the context from vars.Contexts for the request.

func (*MetaManager) WithAdminToken

func (m *MetaManager) WithAdminToken() (err error)

type TestFileManager added in v3.8.1

type TestFileManager struct {
	*MetaManager
}

func NewFileManager added in v3.8.1

func NewFileManager(m *MetaManager) *TestFileManager

func (*TestFileManager) DeleteLocalDB added in v3.8.1

func (m *TestFileManager) DeleteLocalDB(ctx context.Context) error

type TestGroupManager

type TestGroupManager struct {
	*MetaManager
}

func NewGroupManager

func NewGroupManager(m *MetaManager) *TestGroupManager

func (*TestGroupManager) CreateGroups

func (m *TestGroupManager) CreateGroups(ctx context.Context) error

CreateGroups creates group chats. It needs to create both large group chats and regular group chats. The number of large group chats to be created is specified by vars.LargeGroupNum, and the group owner cycles from 0 to vars.UserNum. Every user creates regular group chats, and the number of regular group chats to be created is specified by vars.CommonGroupNum.

type TestMsgManager added in v3.8.1

type TestMsgManager struct {
	*MetaManager
}

func NewMsgManager added in v3.8.1

func NewMsgManager(m *MetaManager) *TestMsgManager

func (*TestMsgManager) SendMessages added in v3.8.1

func (m *TestMsgManager) SendMessages(ctx context.Context) error

SendMessages send messages.The rules are: each user sends `vars.SingleMessageNum` messages to all friends, and sends `vars.GroupMessageNum` messages to all large groups and common groups created by themselves.

type TestRelationManager

type TestRelationManager struct {
	*MetaManager
}

func NewRelationManager

func NewRelationManager(m *MetaManager) *TestRelationManager

func (*TestRelationManager) ImportFriends

func (m *TestRelationManager) ImportFriends(ctx context.Context) error

ImportFriends Import all users as friends of the superuser (excluding themselves), making the superuser have all users as friends, while regular users have the superuser as their only friend. A superuser is defined as a user who has all users as friends, their IDs range from 0 to vars.SuperUserNum.

type TestUserManager

type TestUserManager struct {
	*MetaManager
}

func NewUserManager

func NewUserManager(m *MetaManager) *TestUserManager

func (*TestUserManager) ForceLogoutAllUsers added in v3.8.1

func (t *TestUserManager) ForceLogoutAllUsers(ctx context.Context) error

func (*TestUserManager) GenAllUserIDs

func (t *TestUserManager) GenAllUserIDs() []string

func (*TestUserManager) InitAllSDK added in v3.8.1

func (t *TestUserManager) InitAllSDK(ctx context.Context) error

func (*TestUserManager) LoginAllUsers added in v3.8.1

func (t *TestUserManager) LoginAllUsers(ctx context.Context) error

func (*TestUserManager) LoginByRate

func (t *TestUserManager) LoginByRate(ctx context.Context) error

func (*TestUserManager) LoginLastUsers added in v3.8.1

func (t *TestUserManager) LoginLastUsers(ctx context.Context) error

func (*TestUserManager) RegisterAllUsers added in v3.8.1

func (t *TestUserManager) RegisterAllUsers(ctx context.Context) error

Jump to

Keyboard shortcuts

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