pkg/

directory
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0

Directories

Path Synopsis
Package app runs the application as one process: a frontend and a backend that talk to each other through the internal API over an in-process transport, exactly as two processes would over the network.
Package app runs the application as one process: a frontend and a backend that talk to each other through the internal API over an in-process transport, exactly as two processes would over the network.
backend
body
Package bodybackend is the body service: a user's scale readings and DEXA scans, the estimates computed from them and the rules for importing readings from a source such as Withings.
Package bodybackend is the body service: a user's scale readings and DEXA scans, the estimates computed from them and the rules for importing readings from a source such as Withings.
main
Package mainbackend is the main backend, the process behind `dexafix serve api`.
Package mainbackend is the main backend, the process behind `dexafix serve api`.
Package estimate builds one estimated result per day from DEXA scans and scale/body-composition readings.
Package estimate builds one estimated result per day from DEXA scans and scale/body-composition readings.
Package frontend serves the HTML pages (Go templates + htmx).
Package frontend serves the HTML pages (Go templates + htmx).
Package mailer sends plain-text e-mail through an SMTP server.
Package mailer sends plain-text e-mail through an SMTP server.
Package models holds the domain types shared by the store, estimator and web layers.
Package models holds the domain types shared by the store, estimator and web layers.
Package shared is the parent of the packages that the frontend and the backend have in common.
Package shared is the parent of the packages that the frontend and the backend have in common.
apiclient
Package apiclient is how the frontend process talks to the backend process.
Package apiclient is how the frontend process talks to the backend process.
bodyapi
Package bodyapi is the contract between the main backend and the body service, the part that holds a user's scale readings and DEXA scans and computes their estimates.
Package bodyapi is the contract between the main backend and the body service, the part that holds a user's scale readings and DEXA scans and computes their estimates.
edge
Package edge holds the HTTP edge code shared by the frontend and the backend process: working out who the visitor is behind a reverse proxy, the PROXY protocol, and request limiting.
Package edge holds the HTTP edge code shared by the frontend and the backend process: working out who the visitor is behind a reverse proxy, the PROXY protocol, and request limiting.
inproc
Package inproc is an http.RoundTripper that runs a request against an http.Handler in the same process.
Package inproc is an http.RoundTripper that runs a request against an http.Handler in the same process.
jobs
Package jobs tracks the background jobs of one half of the application.
Package jobs tracks the background jobs of one half of the application.
mtls
Package mtls secures the link between the web (frontend) and api (backend) processes with mutual TLS: the backend only talks to a client that presents a certificate from the configured CA, and the frontend only talks to a backend that presents one.
Package mtls secures the link between the web (frontend) and api (backend) processes with mutual TLS: the backend only talks to a client that presents a certificate from the configured CA, and the frontend only talks to a backend that presents one.
must
Package must turns an error that cannot happen into a panic, so that a caller does not carry a branch no test can reach.
Package must turns an error that cannot happen into a panic, so that a caller does not carry a branch no test can reach.
netguard
Package netguard keeps the backend's own outgoing connections (to an administrator's sign-in providers and mail server) away from addresses that a typo or a hostile setting must not be able to reach: the cloud metadata services and the other addresses on a link, and, unless an administrator allows it, the private networks the server sits in.
Package netguard keeps the backend's own outgoing connections (to an administrator's sign-in providers and mail server) away from addresses that a typo or a hostile setting must not be able to reach: the cloud metadata services and the other addresses on a link, and, unless an administrator allows it, the private networks the server sits in.
timezones
Package timezones lists the common IANA time zones and validates a name.
Package timezones lists the common IANA time zones and validates a name.
tlsutil
Package tlsutil checks PEM certificates; the frontend serves them and the backend stores them.
Package tlsutil checks PEM certificates; the frontend serves them and the backend stores them.
workerapi
Package workerapi is the contract between the backend and the workers: processes that talk to outside services (Withings, Strength Level, ...) for the backend and have no database.
Package workerapi is the contract between the backend and the workers: processes that talk to outside services (Withings, Strength Level, ...) for the backend and have no database.
Package store defines the persistence interface used by the application.
Package store defines the persistence interface used by the application.
sqlstore
Package sqlstore implements store.Store on top of bun, for SQLite and PostgreSQL.
Package sqlstore implements store.Store on top of bun, for SQLite and PostgreSQL.
valkeystate
Package valkeystate keeps the state that must agree across backend processes and is touched on every sign-in in Valkey (or any Redis-compatible server) instead of the database: the failed attempt counters and the single-use nonces.
Package valkeystate keeps the state that must agree across backend processes and is touched on every sign-in in Valkey (or any Redis-compatible server) instead of the database: the failed attempt counters and the single-use nonces.
Package workers is the parent folder of the worker processes' code: one package per provider (pkg/workers/withings, pkg/workers/strengthlevel, ...) next to the generic loop in pkg/workers/runner.
Package workers is the parent folder of the worker processes' code: one package per provider (pkg/workers/withings, pkg/workers/strengthlevel, ...) next to the generic loop in pkg/workers/runner.
builtin
Package builtin lists the workers that ship with the program, so the processes that run them (dexafix serve worker, and the single-process mode) choose providers by name without knowing any of them.
Package builtin lists the workers that ship with the program, so the processes that run them (dexafix serve worker, and the single-process mode) choose providers by name without knowing any of them.
runner
Package runner is the loop every worker runs: register with the backend, lease jobs, run the handler of the job's kind while renewing the lease, and report how it ended.
Package runner is the loop every worker runs: register with the backend, lease jobs, run the handler of the job's kind while renewing the lease, and report how it ended.
strengthlevel
Package strengthlevel is the worker for Strength Level.
Package strengthlevel is the worker for Strength Level.
withings
Package withings is the worker for Withings: it talks to the Withings API for the backend.
Package withings is the worker for Withings: it talks to the Withings API for the backend.

Jump to

Keyboard shortcuts

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