voiceapi

package
v0.0.0-...-93e3117 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package voiceapi adapts the versioned voice WebSocket protocol to a coordinator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatPresence

type ChatPresence struct {
	Occupied       bool      `json:"occupied"`
	OwnedByBrowser bool      `json:"owned_by_browser"`
	DeviceKind     string    `json:"device_kind,omitempty"`
	StartedAt      time.Time `json:"started_at,omitempty"`
}

ChatPresence describes the live device holding a voice chat lease.

type Handler

type Handler struct {
	Backend backend
	Token   string
	Lease   *voice.CallLease
	Updates androidUpdateSource
	Devices *phonedevice.Hub
	Auth    *deviceauth.Registry
	// contains filtered or unexported fields
}

Handler serves voice calls for one Koder process.

func NewHandler

func NewHandler(backend backend, token string) *Handler

NewHandler creates a process-scoped voice protocol handler.

func (*Handler) MintBrowserTicket

func (h *Handler) MintBrowserTicket(clientID string) (string, time.Time, error)

MintBrowserTicket creates a short-lived, single-use WebSocket credential for an already-connected browser client.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP accepts one authenticated voice call.

func (*Handler) VoiceChatPresence

func (h *Handler) VoiceChatPresence(chatID, browserClientID string) ChatPresence

VoiceChatPresence reports whether a selected voice chat is currently in use.

Jump to

Keyboard shortcuts

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