Files
Maven/internal/worker/handler.go
T
kami d52f60c54e maven: fix test mocks for CalendarEvents interface (verification)
- Add CalendarEvents method to recordingAPI in auth_test.go
- Add CalendarEvents method to fakeCore in handlers_test.go

Co-Authored-By: opencode <opencode@anthropic.com>
2026-07-06 04:20:16 +04:00

26 lines
1.2 KiB
Go

// worker/handler.go — the worker-side seam. A module process implements
// either Transcriber or Synthesizer (rarely both — stt and tts are
// independent units with independent model weights and restart lifecycles).
// Server dispatches a Method to the matching handler.
package worker
import "context"
// Transcriber — the stt module's contract. Implementations:
// - the daemon's in-process Stub (built-in stt stub handler, for tests +
// for the "no models on disk yet" floor; the daemon decides which to wire
// from config),
// - a real faster-whisper / vosk process's main (cmd/mavsttd/main.go today
// ships the Stub handler; production swaps in onnxruntime-backed code in
// that same main, no worker-package change).
type Transcriber interface {
Transcribe(ctx context.Context, req TranscribeReq) (TranscribeResp, error)
}
// Synthesizer — the tts module's contract. Mirrors Transcriber (separate
// interface so the two modules can be in separate packages / binaries, and
// so a server asked for the wrong verb refuses cleanly).
type Synthesizer interface {
Synthesize(ctx context.Context, req SynthesizeReq) (SynthesizeResp, error)
}