Documentation
¶
Index ¶
- Constants
- func EmitControlMessageEventJS(roomIDJsCode, eventJSONJsCode string) string
- func EmitControlMessageSyncJS() string
- func EmitControlMessageVerificationJS(stageJSCode, txnIDJSCode, userIDJSCode, deviceIDJSCode, dataJSCode string) string
- func NewJSClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, error)
- func SetupJSLogs(filename string)
- func WriteJSLogs()
- type ControlMessage
- type ControlMessageEvent
- type ControlMessageSync
- type ControlMessageVerification
- type JSClient
- func (c *JSClient) Backpaginate(t ct.TestLike, roomID string, count int) error
- func (c *JSClient) BackupKeys(t ct.TestLike) (recoveryKey string, err error)
- func (c *JSClient) Close(t ct.TestLike)
- func (c *JSClient) CurrentAccessToken(t ct.TestLike) string
- func (c *JSClient) DeletePersistentStorage(t ct.TestLike)
- func (c *JSClient) ForceClose(t ct.TestLike)
- func (c *JSClient) GetEvent(t ct.TestLike, roomID, eventID string) (*api.Event, error)
- func (c *JSClient) GetEventShield(t ct.TestLike, roomID, eventID string) (*api.EventShield, error)
- func (c *JSClient) GetNotification(t ct.TestLike, roomID, eventID string) (*api.Notification, error)
- func (c *JSClient) InviteUser(t ct.TestLike, roomID, userID string) error
- func (c *JSClient) IsRoomEncrypted(t ct.TestLike, roomID string) (bool, error)
- func (c *JSClient) ListenForVerificationRequests(t ct.TestLike) chan api.VerificationStage
- func (c *JSClient) LoadBackup(t ct.TestLike, recoveryKey string) error
- func (c *JSClient) Logf(t ct.TestLike, format string, args ...interface{})
- func (c *JSClient) Login(t ct.TestLike, opts api.ClientCreationOpts) error
- func (c *JSClient) Opts() api.ClientCreationOpts
- func (c *JSClient) RequestOwnUserVerification(t ct.TestLike) chan api.VerificationStage
- func (c *JSClient) SendMessage(t ct.TestLike, roomID, text string) (eventID string, err error)
- func (c *JSClient) StartSyncing(t ct.TestLike) (stopSyncing func(), err error)
- func (c *JSClient) Type() api.ClientTypeLang
- func (c *JSClient) UserID() string
- func (c *JSClient) WaitUntilEventInRoom(t ct.TestLike, roomID string, checker func(e api.Event) bool) api.Waiter
- type JSEvent
- type MessageType
Constants ¶
View Source
const CONSOLE_LOG_CONTROL_STRING = "CC:"
The unique console log line prefix which denotes a control message to the test rig. The text after this string is a JSON object which contains information on the type of update (e.g a new event, a verification request)
For example:
CC:{"t":1,"d":{"RoomID":"!foo:bar","Event":{...}}}
Variables ¶
This section is empty.
Functions ¶
func EmitControlMessageSyncJS ¶
func EmitControlMessageSyncJS() string
func NewJSClient ¶
func SetupJSLogs ¶
func SetupJSLogs(filename string)
func WriteJSLogs ¶
func WriteJSLogs()
Types ¶
type ControlMessage ¶
type ControlMessage struct {
Type MessageType `json:"t"`
Data json.RawMessage `json:"d"`
}
func (*ControlMessage) AsControlMessageEvent ¶
func (c *ControlMessage) AsControlMessageEvent() *ControlMessageEvent
func (*ControlMessage) AsControlMessageSync ¶
func (c *ControlMessage) AsControlMessageSync() *ControlMessageSync
func (*ControlMessage) AsControlMessageVerification ¶
func (c *ControlMessage) AsControlMessageVerification() *ControlMessageVerification
type ControlMessageEvent ¶
type ControlMessageSync ¶
type ControlMessageSync struct{}
type JSClient ¶
type JSClient struct {
// contains filtered or unexported fields
}
func (*JSClient) Backpaginate ¶
func (*JSClient) BackupKeys ¶
func (*JSClient) Close ¶
Close is called to clean up resources. Specifically, we need to shut off existing browsers and any FFI bindings. If we get callbacks/events after this point, tests may panic if the callbacks log messages.
func (*JSClient) DeletePersistentStorage ¶
func (*JSClient) ForceClose ¶
func (*JSClient) GetEventShield ¶
func (*JSClient) GetNotification ¶
func (*JSClient) InviteUser ¶
func (*JSClient) IsRoomEncrypted ¶
IsRoomEncrypted returns true if the room is encrypted. May return an error e.g if you provide a bogus room ID.
func (*JSClient) ListenForVerificationRequests ¶
func (c *JSClient) ListenForVerificationRequests(t ct.TestLike) chan api.VerificationStage
func (*JSClient) LoadBackup ¶
func (*JSClient) Opts ¶
func (c *JSClient) Opts() api.ClientCreationOpts
func (*JSClient) RequestOwnUserVerification ¶
func (c *JSClient) RequestOwnUserVerification(t ct.TestLike) chan api.VerificationStage
func (*JSClient) SendMessage ¶
func (*JSClient) StartSyncing ¶
StartSyncing to begin syncing from sync v2 / sliding sync. Tests should call stopSyncing() at the end of the test.
func (*JSClient) Type ¶
func (c *JSClient) Type() api.ClientTypeLang
type MessageType ¶
type MessageType int
const ( MessageTypeEvent MessageType = 1 MessageTypeSync MessageType = 2 MessageTypeVerification MessageType = 3 )
Click to show internal directories.
Click to hide internal directories.