manager

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 20 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) GetSecret

func (m *MetaManager) GetSecret() string

func (*MetaManager) GetToken

func (m *MetaManager) GetToken(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 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 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) GenAllUserIDs

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

func (*TestUserManager) InitSDK

func (t *TestUserManager) InitSDK(ctx context.Context, userIDs ...string) error

func (*TestUserManager) Login

func (t *TestUserManager) Login(ctx context.Context, userIDs ...string) error

func (*TestUserManager) LoginByRate

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

func (*TestUserManager) RegisterUsers

func (t *TestUserManager) RegisterUsers(ctx context.Context, userIDs ...string) error

Jump to

Keyboard shortcuts

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