internal/

directory
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT

Directories

Path Synopsis
Package acme wires golang.org/x/crypto/acme/autocert so a bare VPS can get a Let's Encrypt certificate straight from the single moth binary via --acme-domain, with no reverse proxy in front.
Package acme wires golang.org/x/crypto/acme/autocert so a bare VPS can get a Let's Encrypt certificate straight from the single moth binary via --acme-domain, with no reverse proxy in front.
Package analytics runs the milestone-07 aggregate-and-prune job: it rolls the raw event stream up into per-project daily_stats rows (bucketed in each project's rollup timezone) and prunes events older than the project's retention window.
Package analytics runs the milestone-07 aggregate-and-prune job: it rolls the raw event stream up into per-project daily_stats rows (bucketed in each project's rollup timezone) and prunes events older than the project's retention window.
Package audit records the append-only admin/security audit log.
Package audit records the append-only admin/security audit log.
Package backup produces and restores a single-file archive of a moth data directory: an online-consistent snapshot of the SQLite database plus the uploads and key material.
Package backup produces and restores a single-file archive of a moth data directory: an online-consistent snapshot of the SQLite database plus the uploads and key material.
Package billing validates App Store and Google Play subscription receipts and parses the two stores' server notifications, mapping both into one normalized model.
Package billing validates App Store and Google Play subscription receipts and parses the two stores' server notifications, mapping both into one normalized model.
Package cli implements the moth binary's remote-client mode: named contexts (server URL + personal access token) stored in ~/.config/moth/config.toml, connect clients for the moth.admin.v1 services authenticated by that token, and the declarative dump/apply logic built on ProjectSpec.
Package cli implements the moth binary's remote-client mode: named contexts (server URL + personal access token) stored in ~/.config/moth/config.toml, connect clients for the moth.admin.v1 services authenticated by that token, and the declarative dump/apply logic built on ProjectSpec.
Package config resolves the moth server configuration.
Package config resolves the moth server configuration.
Package docs embeds the moth documentation and serves it, rendered to self-contained HTML, at /docs inside the binary.
Package docs embeds the moth documentation and serves it, rendered to self-contained HTML, at /docs inside the binary.
Package entitlements holds the pure entitlement-derivation engine: given a user's subscription rows and grants, it computes the set of entitlement identifiers the user currently holds.
Package entitlements holds the pure entitlement-derivation engine: given a user's subscription rows and grants, it computes the set of entitlement identifiers the user currently holds.
Package events captures the server-emitted analytics events of milestone 07.
Package events captures the server-emitted analytics events of milestone 07.
Package fonts ships the curated set of open-license typefaces a project theme can pick from (plan/06).
Package fonts ships the curated set of open-license typefaces a project theme can pick from (plan/06).
Package httpsec is the security-header middleware for moth's HTML and JSON surfaces: a strict Content-Security-Policy, HSTS (https only), X-Content-Type-Options, Referrer-Policy and frame options.
Package httpsec is the security-header middleware for moth's HTML and JSON surfaces: a strict Content-Security-Policy, HSTS (https only), X-Content-Type-Options, Referrer-Policy and frame options.
Package i18n is moth's self-contained message catalog and locale negotiation.
Package i18n is moth's self-contained message catalog and locale negotiation.
Package jwt signs and verifies moth access tokens: compact JWS with ES256, a kid header, and the fixed claim set moth mints.
Package jwt signs and verifies moth access tokens: compact JWS with ES256, a kid header, and the fixed claim set moth mints.
Package keys manages the instance master key and per-project ES256 signing keypairs.
Package keys manages the instance master key and per-project ES256 signing keypairs.
Package mail delivers moth's transactional emails.
Package mail delivers moth's transactional emails.
Package metrics is moth's lightweight instrumentation: a small in-process registry of counters and latency histograms and an http.Handler that renders them in Prometheus text exposition format (version 0.0.4).
Package metrics is moth's lightweight instrumentation: a small in-process registry of counters and latency histograms and an http.Handler that renders them in Prometheus text exposition format (version 0.0.4).
Package netutil derives the real client IP behind an optional set of trusted reverse proxies.
Package netutil derives the real client IP behind an optional set of trusted reverse proxies.
Package oidc verifies Google and Apple ID tokens for social sign-in and talks to the providers' OAuth token endpoints.
Package oidc verifies Google and Apple ID tokens for social sign-in and talks to the providers' OAuth token endpoints.
Package password hashes and verifies passwords with argon2id.
Package password hashes and verifies passwords with argon2id.
Package paywall defines the per-project paywall configuration: the copy and layout knobs that the SDK's batteries-included paywall screen renders from (milestone 13).
Package paywall defines the per-project paywall configuration: the copy and layout knobs that the SDK's batteries-included paywall screen renders from (milestone 13).
Package profile defines the per-project setup profile (milestone 22): the creation wizard's answers — platforms, sign-in intent, monetization and push intent, plus the checklist-dismissed flag.
Package profile defines the per-project setup profile (milestone 22): the creation wizard's answers — platforms, sign-in intent, monetization and push intent, plus the checklist-dismissed flag.
Package push defines the per-project push settings: the enabled switch for the push-device registry (milestone 20) and the Web Push VAPID public key browser clients subscribe with.
Package push defines the per-project push settings: the enabled switch for the push-device registry (milestone 20) and the Web Push VAPID public key browser clients subscribe with.
Package pwimport verifies foreign password hashes so users migrated from another auth system (Firebase, Auth0, Supabase, a home-grown backend) can sign in with their existing password without a reset.
Package pwimport verifies foreign password hashes so users migrated from another auth system (Firebase, Auth0, Supabase, a home-grown backend) can sign in with their existing password without a reset.
Package ratelimit is moth's shared, SQLite-backed rate limiter for the credential-facing surfaces.
Package ratelimit is moth's shared, SQLite-backed rate limiter for the credential-facing surfaces.
Package server assembles the moth HTTP handler: connect (gRPC / gRPC-Web) services and the plain-HTTP surfaces, multiplexed on one port.
Package server assembles the moth HTTP handler: connect (gRPC / gRPC-Web) services and the plain-HTTP surfaces, multiplexed on one port.
rpc/admin
Package adminrpc implements the moth.admin.v1 connect services.
Package adminrpc implements the moth.admin.v1 connect services.
rpc/auth
Package authrpc implements moth.auth.v1.AuthService — the public end-user authentication API.
Package authrpc implements moth.auth.v1.AuthService — the public end-user authentication API.
rpc/billing
Package billingrpc implements moth.billing.v1.BillingService — the publishable-key + Bearer client API for subscriptions and entitlements — and hosts the shared store-validation plumbing the webhook and reconciliation sweep reuse.
Package billingrpc implements moth.billing.v1.BillingService — the publishable-key + Bearer client API for subscriptions and entitlements — and hosts the shared store-validation plumbing the webhook and reconciliation sweep reuse.
rpc/push
Package pushrpc implements moth.push.v1.PushService — the publishable-key + Bearer client API for the push-device registry (milestone 20).
Package pushrpc implements moth.push.v1.PushService — the publishable-key + Bearer client API for the push-device registry (milestone 20).
rpc/serverapi
Package serverapi implements moth.server.v1 — the services the developer's own backend calls with the project secret key (`x-moth-key: sk_...`): online token introspection and programmatic user management.
Package serverapi implements moth.server.v1 — the services the developer's own backend calls with the project secret key (`x-moth-key: sk_...`): online token introspection and programmatic user management.
Package setup implements the provider-console orchestration behind `moth setup google`, `moth setup apple` and `moth doctor`: guided or partially automated configuration of the Google/Apple sign-in consoles for one moth project, always followed by verification.
Package setup implements the provider-console orchestration behind `moth setup google`, `moth setup apple` and `moth doctor`: guided or partially automated configuration of the Google/Apple sign-in consoles for one moth project, always followed by verification.
Package skill renders the embedded moth agent skill: a SKILL.md + references/ directory (the Agent Skills format) teaching a coding agent both halves of moth — integrating the Flutter SDK into an app and administering an instance through the CLI.
Package skill renders the embedded moth agent skill: a SKILL.md + references/ directory (the Agent Skills format) teaching a coding agent both halves of moth — integrating the Flutter SDK into an app and administering an instance through the CLI.
Package store is the SQLite persistence layer: connection setup, embedded migrations, and hand-written queries behind small per-domain interfaces (no ORM).
Package store is the SQLite persistence layer: connection setup, embedded migrations, and hand-written queries behind small per-domain interfaces (no ORM).
Package theme defines the per-project design system: a small, versioned set of tokens (colors, typography, spacing, corner radius, logo, legal links) that every end-user surface — the Flutter login screen, hosted web pages, emails — renders from.
Package theme defines the per-project design system: a small, versioned set of tokens (colors, typography, spacing, corner radius, logo, legal links) that every end-user surface — the Flutter login screen, hosted web pages, emails — renders from.
Package token generates and hashes the random secrets moth hands out: publishable/secret API keys, admin session tokens, setup tokens.
Package token generates and hashes the random secrets moth hands out: publishable/secret API keys, admin session tokens, setup tokens.
Package version exposes the build version of the moth binary.
Package version exposes the build version of the moth binary.

Jump to

Keyboard shortcuts

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