Documentation
¶
Overview ¶
Package rtm is a hand-written client for Slack's legacy Real Time Messaging API — the WebSocket stream that works with a user/session token (xoxc+xoxd), the credential a browser web-client session already has. Unlike Socket Mode (which needs an app-level token and acks enveloped work items), RTM delivers raw event objects and requires no ack; the client just reads frames and keeps the socket alive with periodic pings. RTM is legacy and not officially supported for xoxc tokens — see DECISIONS.md ("listen transports").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// OpenURL fetches a fresh wss:// URL (rtm.connect). RTM URLs are single-use and must be
// connected within ~30s, so every (re)connection asks for a new one.
OpenURL func(ctx context.Context) (string, error)
// Dial opens the websocket. Defaults to coder/websocket; injectable for tests.
Dial func(ctx context.Context, url string) (conn, error)
// Log receives connection-lifecycle notes (connected, reconnecting). Never event data.
Log io.Writer
// Header carries credential headers on the WebSocket handshake. For a browser-session
// token this holds `Cookie: d=<xoxd>`, which the RTM gateway validates on the UPGRADE —
// the URL ticket alone answers invalid_auth for xoxc tokens.
Header http.Header
// PingInterval is how often to send an application-level RTM ping to keep the
// connection alive. Zero uses the 30s default; negative disables pings (tests).
PingInterval time.Duration
// contains filtered or unexported fields
}
Client streams raw RTM event frames.
Click to show internal directories.
Click to hide internal directories.