tests

package
v0.0.0-...-cedc2d2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncrementingNonceGenerator

type IncrementingNonceGenerator struct {
	// contains filtered or unexported fields
}

IncrementingNonceGenerator starts at nonce1 and increments each by +1: nonce1, nonce2, ..., nonceN

func (*IncrementingNonceGenerator) GetNonce

func (m *IncrementingNonceGenerator) GetNonce() string

GetNonce returns an incrementing nonce value.

type TestAsync

type TestAsync struct {
	Sent []interface{}
	// contains filtered or unexported fields
}

func (*TestAsync) Close

func (t *TestAsync) Close()

func (*TestAsync) Connect

func (t *TestAsync) Connect() error

func (*TestAsync) Done

func (t *TestAsync) Done() <-chan error

func (*TestAsync) DumpSentMessages

func (t *TestAsync) DumpSentMessages()

func (*TestAsync) Listen

func (t *TestAsync) Listen() <-chan []byte

func (*TestAsync) Publish

func (t *TestAsync) Publish(raw string)

func (*TestAsync) Send

func (t *TestAsync) Send(ctx context.Context, msg interface{}) error

func (*TestAsync) SentCount

func (t *TestAsync) SentCount() int

type TestAsyncFactory

type TestAsyncFactory struct {
	Count int
	Async websocket.Asynchronous
}

does not work for reconnect tests

func (*TestAsyncFactory) Create

type TestWsService

type TestWsService struct {
	// contains filtered or unexported fields
}

func NewTestWsService

func NewTestWsService(port int) *TestWsService

func (*TestWsService) Broadcast

func (s *TestWsService) Broadcast(msg string)

Broadcast sends a message to all connected clients.

func (*TestWsService) PublishOnConnect

func (s *TestWsService) PublishOnConnect(msg string)

func (*TestWsService) Received

func (s *TestWsService) Received(clientNum int, msgNum int) (string, error)

Received starts indexing clients and message positions at position 0.

func (*TestWsService) ReceivedCount

func (s *TestWsService) ReceivedCount(clientNum int) int

ReceivedCount starts indexing clients at position 0.

func (*TestWsService) ServeHTTP

func (s *TestWsService) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*TestWsService) Start

func (s *TestWsService) Start() error

nolint

func (*TestWsService) Stop

func (s *TestWsService) Stop()

func (*TestWsService) TotalClientCount

func (s *TestWsService) TotalClientCount() int

func (*TestWsService) WaitForClientCount

func (s *TestWsService) WaitForClientCount(count int) error

func (*TestWsService) WaitForMessage

func (s *TestWsService) WaitForMessage(clientNum int, msgNum int) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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