tests

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 4 Imported by: 0

README

This folder holds full integration tests between node and orchestrator

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBot

type MockBot struct {
	SessionEstablishedFunc func(info node.SessionInfo)

	StopShardFunc   func(shard int) (sessionID string, sequence int64, resumeGatewayUrl string)
	ResumeShardFunc func(shard int, sessionID string, sequence int64, resumeGatewayUrl string)
	AddNewShardFunc func(shards ...int)

	// Caled when the bot should shut down, make sure to send EvtShutdown when completed
	ShutdownFunc func()

	InitializeShardTransferFromFunc func(shard int) (sessionID string, sequence int64, resumeGatewayUrl string)
	InitializeShardTransferToFunc   func(shard int, sessionID string, sequence int64, resumeGatewayUrl string)

	// this should return when all user events has been sent, with the number of user events sent
	StartShardTransferFromFunc func(shard int) (numEventsSent int)

	HandleUserEventFunc func(evt dshardorchestrator.EventType, data interface{})
}

func (*MockBot) AddNewShards

func (mn *MockBot) AddNewShards(shards ...int)

func (*MockBot) HandleUserEvent

func (mn *MockBot) HandleUserEvent(evt dshardorchestrator.EventType, data interface{})

func (*MockBot) InitializeShardTransferFrom

func (mn *MockBot) InitializeShardTransferFrom(shard int) (sessionID string, sequence int64, resumeGatewayUrl string)

func (*MockBot) InitializeShardTransferTo

func (mn *MockBot) InitializeShardTransferTo(shard int, sessionID string, sequence int64, resumeGatewayUrl string)

func (*MockBot) ResumeShard

func (mn *MockBot) ResumeShard(shard int, sessionID string, sequence int64, resumeGatewayUrl string)

func (*MockBot) SessionEstablished

func (mn *MockBot) SessionEstablished(info node.SessionInfo)

func (*MockBot) Shutdown

func (mn *MockBot) Shutdown()

Caled when the bot should shut down, make sure to send EvtShutdown when completed

func (*MockBot) StartShardTransferFrom

func (mn *MockBot) StartShardTransferFrom(shard int) (numEventsSent int)

this should return when all user events has been sent, with the number of user events sent

func (*MockBot) StopShard

func (mn *MockBot) StopShard(shard int) (sessionID string, sequence int64, resumeGatewayUrl string)

Jump to

Keyboard shortcuts

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