Documentation ¶
Index ¶
- type CreateRoomReqBody
- type RequestedUserInfo
- type Room
- type RoomManager
- func (p *RoomManager) CheckCreatingRoomsOK() bool
- func (p *RoomManager) CheckCreatingUsersOK() bool
- func (p *RoomManager) Close()
- func (p *RoomManager) GetCreatedRooms() int
- func (p *RoomManager) GetCreatingRoomAvgDuration() time.Duration
- func (p *RoomManager) GetCreatingUsersAvgDuration() time.Duration
- func (p *RoomManager) GetTotalUsers() int
- func (p *RoomManager) RequestAllRooms(when time.Time) error
- func (p *RoomManager) RequestRoom() error
- type RoomUnit
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRoomReqBody ¶ added in v0.1.2
type RequestedUserInfo ¶
type RoomManager ¶
type RoomManager struct { Addr string RoomSize int UserSize int MsgLen int Frequency int LckRoom sync.Mutex Rooms []*RoomUnit Start bool HttpTimeout time.Duration WSTimeout time.Duration AppID string SingleClientMode int ParallelRequest bool NotifyUserAdd <-chan int // chan 大小为 用户总数 // contains filtered or unexported fields }
func NewRoomManager ¶
func NewRoomManager(addr string, room, user, msgLen, frequency, httpTimeout, webSocketTimeout int, appID string, singleClientMode int, parallel int) *RoomManager
NewRoomManager will return a RoomManager
func (*RoomManager) CheckCreatingRoomsOK ¶ added in v0.2.0
func (p *RoomManager) CheckCreatingRoomsOK() bool
func (*RoomManager) CheckCreatingUsersOK ¶ added in v0.2.0
func (p *RoomManager) CheckCreatingUsersOK() bool
func (*RoomManager) Close ¶ added in v0.2.0
func (p *RoomManager) Close()
func (*RoomManager) GetCreatedRooms ¶ added in v0.2.0
func (p *RoomManager) GetCreatedRooms() int
func (*RoomManager) GetCreatingRoomAvgDuration ¶
func (p *RoomManager) GetCreatingRoomAvgDuration() time.Duration
GetCreatingRoomAvgDuration return the average time consumption of all rooms which are created successfully
func (*RoomManager) GetCreatingUsersAvgDuration ¶
func (p *RoomManager) GetCreatingUsersAvgDuration() time.Duration
func (*RoomManager) GetTotalUsers ¶ added in v0.2.0
func (p *RoomManager) GetTotalUsers() int
func (*RoomManager) RequestAllRooms ¶ added in v0.1.4
func (p *RoomManager) RequestAllRooms(when time.Time) error
RequestAllRooms will request all the rooms from the server. param when is the start time for Request room from server concurrently [Only useful when parallel is true] param mode is the mode for Request room. true means parallel and false means serial
func (*RoomManager) RequestRoom ¶ added in v0.1.4
func (p *RoomManager) RequestRoom() error
type RoomUnit ¶
type RoomUnit struct { Address string // server+port Schema string RoomId int // room ID Password string PingInterval int // ws/wss PingTimeout int // ws/wss RtcToken string Users []*User // valid users in room AppId string ExpireTime int SdkVersion string // for statistics ConnectionDuration time.Duration // contains filtered or unexported fields }
func NewRoom ¶
func NewRoom(host string, httpTimeout, wsTimeout time.Duration, maximumUsers, msgLength, frequency int, appId string, rm *RoomManager) *RoomUnit
NewRoom return a RoomUnit object
func (*RoomUnit) UsersConnection ¶ added in v0.1.4
UsersConnection try to connect to the server and exchange message. param when is the time for requesting of websocket concurrently param mode is the mode for requesting. 0 means parallel and 1 means serial