Documentation
¶
Overview ¶
Package wsutil holds small shared helpers for the provider WebSocket clients. The streaming STT and TTS providers each dial a vendor WebSocket the same way; this package factors out that dial boilerplate so a provider only writes the request and reads the vendor's message frames.
Index ¶
Constants ¶
View Source
const DefaultReadLimit = 1 << 20
DefaultReadLimit bounds a single inbound WebSocket message. Providers stream base64-encoded audio chunks, which fit comfortably in 1 MiB.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(ctx context.Context, url string, header http.Header, readLimit int64) (*websocket.Conn, error)
Dial opens a WebSocket to url with the given headers, closes the handshake response body, and applies readLimit when it is positive. The caller owns the returned connection and must Close it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.