mock_wss_server

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MINIMUM_MESSAGE_FREQUENCY_SECONDS = 10

Minimum time between messages before the server disconnects a client. AKA, "timeout period" * This is a const for now, but it may need to be a flag in the future.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(m *http.ServeMux)

func StartIndividualServer

func StartIndividualServer(port int, reconnectTestTimer int, m *http.ServeMux, ctx context.Context) http.Server

func StartServer

func StartServer(port int, enableDebug bool, reconnectTestTimer int)

Types

type DebugServerButtons

type DebugServerButtons struct {
	Server1 string
	Server2 string
}

Used for template weirdness

type MessageMetadata

type MessageMetadata struct {
	MessageID        string `json:"message_id"`
	MessageType      string `json:"message_type"`
	MessageTimestamp string `json:"message_timestamp"`
}

type ReconnectMessage

type ReconnectMessage struct {
	Metadata MessageMetadata         `json:"metadata"`
	Payload  ReconnectMessagePayload `json:"payload"`
}

type ReconnectMessagePayload

type ReconnectMessagePayload struct {
	Session ReconnectMessagePayloadSession `json:"session"`
}

type ReconnectMessagePayloadSession

type ReconnectMessagePayloadSession struct {
	ID                             string `json:"id"`
	Status                         string `json:"status"`
	MinimumMessageFrequencySeconds *int   `json:"minimum_message_frequency_seconds"`
	ReconnectUrl                   string `json:"reconnect_url"`
	ConnectedAt                    string `json:"connected_at"`
}

type WebsocketConnection

type WebsocketConnection struct {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

type WebsocketServer

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

type WelcomeMessage

type WelcomeMessage struct {
	Metadata MessageMetadata       `json:"metadata"`
	Payload  WelcomeMessagePayload `json:"payload"`
}

type WelcomeMessagePayload

type WelcomeMessagePayload struct {
	Session WelcomeMessagePayloadSession `json:"session"`
}

type WelcomeMessagePayloadSession

type WelcomeMessagePayloadSession struct {
	ID                             string  `json:"id"`
	Status                         string  `json:"status"`
	MinimumMessageFrequencySeconds int     `json:"minimum_message_frequency_seconds"`
	ReconnectUrl                   *string `json:"reconnect_url"`
	ConnectedAt                    string  `json:"connected_at"`
}

Jump to

Keyboard shortcuts

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