Documentation
¶
Overview ¶
Package chalk embeds static assets (migrations, web SPA bundle) into the binary.
Index ¶
Constants ¶
const MigrationsDir = "migrations"
MigrationsDir is the directory name inside the embedded FS. migrate.Load needs both the embed.FS and the directory name.
const WebDir = "web"
WebDir is the directory name inside the embedded FS. The SPA handler uses this + "/dist" to fs.Sub into the bundle root.
Variables ¶
var Migrations embed.FS
Migrations holds every .sql file in the migrations/ directory.
var Web embed.FS
Web holds the SPA's built bundle at web/dist/.
Why dist/ and not the whole web/ tree:
- web/node_modules can be huge (10s of MB) and would bloat the binary
- web/src/ is source, not deployable; not needed at runtime
- the SPA handler navigates into dist/ anyway
Phase 07 introduces web/dist/. Earlier phases shipped a placeholder web/index.html at the web/ root; phase 07 supersedes it with the esbuild output. The Dockerfile's frontend stage produces web/dist/.
For "go build" without a prior `npm run build`, this embed pattern will fail with "pattern web/dist/*: no matching files found". `bootstrap/phase-07-frontend-shell.sh` runs the npm build before `go build` to satisfy this; CI and the Dockerfile follow the same pattern. Local dev: run `cd web && npm run build` once before `go build`.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
chalkctl
command
Command chalkctl is the chalk deployment manager.
|
Command chalkctl is the chalk deployment manager. |
|
chalkd
command
Command chalkd is the chalk server daemon.
|
Command chalkd is the chalk server daemon. |
|
internal
|
|
|
auth
Package auth is chalk's authentication layer.
|
Package auth is chalk's authentication layer. |
|
config
Package config loads chalk's runtime configuration from env and flags.
|
Package config loads chalk's runtime configuration from env and flags. |
|
friends
Package friends implements the friendship state machine on top of the friendships table.
|
Package friends implements the friendship state machine on top of the friendships table. |
|
giphy
Package giphy is a minimal server-side client for Giphy's search API (att-4).
|
Package giphy is a minimal server-side client for Giphy's search API (att-4). |
|
mail
Package mail abstracts outbound email sending for chalk.
|
Package mail abstracts outbound email sending for chalk. |
|
migrate
Package migrate runs the embedded SQL migrations in order, idempotently.
|
Package migrate runs the embedded SQL migrations in order, idempotently. |
|
presence
Package presence implements per-device presence with multi-device aggregation, instance heartbeats, dead-instance cleanup, and stale- state demotion.
|
Package presence implements per-device presence with multi-device aggregation, instance heartbeats, dead-instance cleanup, and stale- state demotion. |
|
proto
Package proto defines chalk's WebSocket wire protocol.
|
Package proto defines chalk's WebSocket wire protocol. |
|
pubsub
Package pubsub bridges between chalkd instances using Postgres LISTEN/NOTIFY.
|
Package pubsub bridges between chalkd instances using Postgres LISTEN/NOTIFY. |
|
server
Package server implements chalk's HTTP and WebSocket layers.
|
Package server implements chalk's HTTP and WebSocket layers. |
|
store
Package store: registration helper.
|
Package store: registration helper. |
|
turncred
Package turncred mints time-limited TURN credentials for coturn's "use-auth-secret" (TURN REST API) scheme (Phase 30, slice 30-1; design §5).
|
Package turncred mints time-limited TURN credentials for coturn's "use-auth-secret" (TURN REST API) scheme (Phase 30, slice 30-1; design §5). |
|
version
Package version exposes build-time identification.
|
Package version exposes build-time identification. |