wsutil

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL