package
0.0.0-20240801115724-302162d5da99
Repository: https://github.com/tkw1536/pkglib.git
Documentation: pkg.go.dev

# Packages

websockettest provides a server for testing.

# Functions

NewBinaryMessage creates a new binary message with the given text.
NewTextMessage creates a new text message with the given text.
RequireProtocols returns a function which enforces that at least one of the given protocols is used by the given request.

# Constants

Different connection states.
Different connection states.
Different connection states.
Defaults for [Options].
Defaults for [Options].
Defaults for [Options].
bytes.
Defaults for [Options].
No description provided by the author
Different connection states.
A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.
Indicates that the server was acting as a gateway or proxy and received an invalid response from the upstream server.
Defined Websocket status codes as per RFC 6455, Section 7.4.1.
Indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.
Indicates that a remote endpoint is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message).
Indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake.
Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.
Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.
A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.
Indicates that an endpoint is terminating the connection because it has received a message that violates its policy.
indicates that an endpoint is terminating the connection due to a protocol error.
Indicates that the service is restarted.
Defined Websocket status codes as per RFC 6455, Section 7.4.1.
Indicates that the service is experiencing overload.
Additional status codes registered in the IANA registry.
indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).

# Variables

ErrConnectionClose indicates that the connection closed because connection.Close was called.
ErrConnectionShutdownWith indicates the connection closed because connection.ShutdownWith was called.

# Structs

CloseCause is returned by calling [close.Cause] on the context of a connection.
CloseFrame represents a closing control frame of a websocket connection.
Connection represents a connection to a single websocket client.
Message represents a message sent between client and server.
Options describes options for connections made to a [Server].
PreparedMessage represents a message that caches its' on-the-wire encoding.
Server implements a websocket server.

# Type aliases

ConnectionState is the state of the connection.
Handler handles a connection sent to the server.
StatusCode is a status code as defined in RFC 6455, Section 7.4.