add basic docs for each package
This commit is contained in:
parent
d4ee12e33a
commit
298265763f
18
doc.go
Normal file
18
doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
// Package main contains the RadChat application entrypoint and HTTP handlers.
|
||||
//
|
||||
// RadChat is a lightweight, self-hostable voice/text chat with WebRTC for
|
||||
// peer-to-peer media and WebSockets for control signaling. The package wires up
|
||||
// HTTP routes for:
|
||||
// - /ws: WebSocket endpoint for signaling (join/leave, ICE, offers/answers, chat)
|
||||
// - /user-count: Small health/info endpoint returning connected users
|
||||
// - /check-username: Validate username rules and collision checks
|
||||
// - /files: Upload endpoint for ephemeral file sharing
|
||||
// - /files/{id}: Download endpoint for previously uploaded files
|
||||
//
|
||||
// Static assets are served from ./static and include the single-page app (SPA)
|
||||
// implemented in static/app.js.
|
||||
//
|
||||
// The main stateful coordination happens in the server subpackage via the Hub
|
||||
// and Client types. This package (
|
||||
// package main) creates, runs, and exposes that hub over HTTP.
|
||||
package main
|
12
server/doc.go
Normal file
12
server/doc.go
Normal file
@ -0,0 +1,12 @@
|
||||
// Package server contains the networking primitives for RadChat.
|
||||
//
|
||||
// It exposes:
|
||||
// - Hub: central registry/bus of connected Clients with broadcast/register/unregister channels
|
||||
// - Client: a single WebSocket connection/user state and its outbound send queue
|
||||
// - Upgrader: an Origin-checking Gorilla WebSocket upgrader factory
|
||||
// - Middleware: simple HTTP middleware for gzip and cache control
|
||||
//
|
||||
// The package is intentionally small: it focuses on safe concurrent access to
|
||||
// client maps and channels, and leaves higher-level HTTP routing and handlers in
|
||||
// the main package.
|
||||
package server
|
Loading…
x
Reference in New Issue
Block a user