Spikard.WebSocketMessage (spikard v0.17.0)

Copy Markdown

A WebSocket message that can be text or binary.

Summary

Types

A binary message.

A close message with a numeric close code (RFC 6455) and optional reason text.

A ping message.

A pong message.

t()

A WebSocket message that can be text or binary.

A text message.

Functions

Returns the serde wire value this variant carries on the JSON boundary (see wire_variant_value in alef's naming module) -- distinct from the atom's Elixir spelling.

Types

binary_variant()

@type binary_variant() :: %{type: :binary, value: binary()}

A binary message.

close()

@type close() :: %{type: :close, code: non_neg_integer(), reason: String.t()}

A close message with a numeric close code (RFC 6455) and optional reason text.

ping()

@type ping() :: %{type: :ping, value: binary()}

A ping message.

pong()

@type pong() :: %{type: :pong, value: binary()}

A pong message.

t()

@type t() :: term()

A WebSocket message that can be text or binary.

text()

@type text() :: %{type: :text, value: String.t()}

A text message.

Functions

close(code, reason)

wire_value(value)

@spec wire_value(t()) :: String.t()

Returns the serde wire value this variant carries on the JSON boundary (see wire_variant_value in alef's naming module) -- distinct from the atom's Elixir spelling.