Help us shape the future of Go! Take the 2026 Go Developer Survey

adapter-mfc

command
v3.14.0 Latest Latest
Warning

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

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

Documentation

Overview

Package main implements adapter-mfc: a microservice that adapts MyFreeCams' FCS WebSocket protocol to a simple HTTP/JSON interface, maintaining a live online-models list and serving the snapshot over HTTP.

On connect the service ingests the bulk MANAGELIST/CAMS dump as the initial snapshot, then applies SESSIONSTATE updates as MFC pushes them. On disconnect it reconnects with exponential backoff.

HTTP routes:

  • GET /online — current snapshot as OnlineListResults JSON. Always 200; when no bulk has been applied yet, the body has failed=true so the caller distinguishes daemon-level failure from transport failure (5xx).
  • GET /status?name=<name> — backs the bot's QueryStatus for MFC. Returns a cmdlib.StreamerInfoWithStatus JSON document; only the status field is populated for MFC. See handleStatus.
  • GET /healthz — liveness probe; always 200 "ok" while the process is responsive. Readiness is signalled by /online's failed flag.
  • GET /version — the build's cmdlib.Version string.

Log convention: @-prefixed keys (@nm, @vs, @uid) are raw protocol fields; bare keys are values resolved from local state.

In-memory online-models state for adapter-mfc, plus the methods that mutate and read it. The snapshot is updated by the websocket reader and served by the HTTP handlers.

FCS websocket wire format: parses raw frame bytes into typed application messages and builds outbound frames for the requests we send. The dispatcher in main.go does a type switch on the parsed result.

Jump to

Keyboard shortcuts

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