mock_wss_server

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const KEEPALIVE_TIMEOUT_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, sslEnabled bool, m *http.ServeMux, ctx context.Context, alternateServer bool) http.Server

func StartServer

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

Types

type DebugServerButtons

type DebugServerButtons struct {
	Server1 string
	Server2 string
}

Used for template weirdness

type KeepaliveMessage added in v1.1.10

type KeepaliveMessage struct {
	Metadata MessageMetadata         `json:"metadata"`
	Payload  KeepaliveMessagePayload `json:"payload"`
}

type KeepaliveMessagePayload added in v1.1.10

type KeepaliveMessagePayload struct{}

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"`
	KeepaliveTimeoutSeconds *int   `json:"keepalive_timeout_seconds"`
	ReconnectUrl            string `json:"reconnect_url"`
	ConnectedAt             string `json:"connected_at"`
}

type WebsocketConnection

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

func (*WebsocketConnection) SendMessage added in v1.1.10

func (wc *WebsocketConnection) SendMessage(messageType int, data []byte) error

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"`
	KeepaliveTimeoutSeconds int     `json:"keepalive_timeout_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