Documentation
¶
Overview ¶
Package socket keeps a Slack Socket Mode connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAuth = errors.New("slack socket: invalid auth")
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
Open func(ctx context.Context) (wssURL string, err error) // apps.connections.open with the app token
Dial func(ctx context.Context, url string) (Socket, error) // nil uses coder/websocket
OnState func(State) // nil ignores
Log func(format string, args ...any)
Queue int // handler buffer, default 4096
// contains filtered or unexported fields
}
func (*Conn) Run ¶
Run acks every envelope on the read loop before it is queued; handle runs on its own goroutine, so a slow handle never delays an ack. A full queue drops the envelope and reports State{Kind: "overflow"}. Backoff 1 s doubling to 30 s, reset after a hello. Returns ctx.Err() when ctx ends, after the running handle returns, or ErrInvalidAuth.
type Envelope ¶
type Envelope struct {
ID, Type, EventID string // EventID from payload.event_id ("" for non-events_api)
RetryAttempt int
RetryReason string
Payload json.RawMessage
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sockettest is a fake Slack Socket Mode server for tests.
|
Package sockettest is a fake Slack Socket Mode server for tests. |