Documentation
¶
Overview ¶
Package gonext holds the embedded templates/ tree used by the scaffolding CLI. It lives at the repository root because go:embed cannot ascend directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Templates embed.FS
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth is gonext's published authentication contract, the one piece of a generated project that is imported rather than scaffolded.
|
Package auth is gonext's published authentication contract, the one piece of a generated project that is imported rather than scaffolded. |
|
cmd
|
|
|
golden
command
Command golden regenerates the committed golden/ dev tree by dogfooding `gonext init` against this repo's own templates/, backing up any existing golden/ first.
|
Command golden regenerates the committed golden/ dev tree by dogfooding `gonext init` against this repo's own templates/, backing up any existing golden/ first. |
|
scaffold
command
Command gonext scaffolds new projects from the gonext templates.
|
Command gonext scaffolds new projects from the gonext templates. |
|
core
|
|
|
security
Package security provides the response-headers and rate-limiting middleware every generated backend mounts.
|
Package security provides the response-headers and rate-limiting middleware every generated backend mounts. |
|
Package dbmigrate registers a generated project's per-domain migrations, orders them by declared dependencies, and applies pending ones using Bun's migration table for bookkeeping.
|
Package dbmigrate registers a generated project's per-domain migrations, orders them by declared dependencies, and applies pending ones using Bun's migration table for bookkeeping. |
|
internal
|
|
|
dev
Package dev implements `gonext dev`: a watch-build-restart loop for a generated project's backend/, run from this repo's own binary rather than vendored into templates/.
|
Package dev implements `gonext dev`: a watch-build-restart loop for a generated project's backend/, run from this repo's own binary rather than vendored into templates/. |
|
exec
Package exec wraps os/exec for the scaffolding CLI's long-running, streamed subprocess steps (go mod tidy, go get -tool, pnpm install).
|
Package exec wraps os/exec for the scaffolding CLI's long-running, streamed subprocess steps (go mod tidy, go get -tool, pnpm install). |
|
generate
Package generate implements the dev-loop generators behind `gonext generate`, writing files into an existing project.
|
Package generate implements the dev-loop generators behind `gonext generate`, writing files into an existing project. |
|
migrate
Package migrate applies a generated project's pending Postgres migrations from this repo, without vendoring a migrate command into every scaffolded project.
|
Package migrate applies a generated project's pending Postgres migrations from this repo, without vendoring a migrate command into every scaffolded project. |
|
openapi
Package openapi produces a generated project's OpenAPI document by materializing a temporary runner that builds its API over infrastructure that never connects, then writes or checks docs/openapi.yaml from it.
|
Package openapi produces a generated project's OpenAPI document by materializing a temporary runner that builds its API over infrastructure that never connects, then writes or checks docs/openapi.yaml from it. |
|
project
Package project locates a generated project's root and materializes the temporary runner files CLI-native subcommands `go run` inside it.
|
Package project locates a generated project's root and materializes the temporary runner files CLI-native subcommands `go run` inside it. |
|
templates
|
|
|
backend
command
Package main is the generated backend's entry point: it builds the dependency graph via wire and runs the assembled App.
|
Package main is the generated backend's entry point: it builds the dependency graph via wire and runs the assembled App. |
|
backend/example
Package example is the public facade for the example domain.
|
Package example is the public facade for the example domain. |
|
backend/example/domain
Package domain holds the example domain's public entities, value objects, domain errors, and repository ports.
|
Package domain holds the example domain's public entities, value objects, domain errors, and repository ports. |
|
backend/example/internal/application
Package application holds the example domain's use cases.
|
Package application holds the example domain's use cases. |
|
backend/example/internal/infrastructure/memory
Package memory provides an in-memory adapter for the example domain's repository ports.
|
Package memory provides an in-memory adapter for the example domain's repository ports. |
|
backend/example/internal/infrastructure/postgres
Package postgres provides the example domain's Postgres-backed adapter for its repository ports.
|
Package postgres provides the example domain's Postgres-backed adapter for its repository ports. |
|
backend/example/internal/presentation
Package presentation exposes the example domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes.
|
Package presentation exposes the example domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes. |
|
backend/internal/config
Package config loads and validates the backend's runtime configuration from environment variables.
|
Package config loads and validates the backend's runtime configuration from environment variables. |
|
backend/internal/database
Package database provides the cross-cutting Postgres connection pool shared by every domain: Connect builds a pgx-backed pool and hands back a *bun.DB for domains to query through.
|
Package database provides the cross-cutting Postgres connection pool shared by every domain: Connect builds a pgx-backed pool and hands back a *bun.DB for domains to query through. |
|
backend/internal/database/dbtest
Package dbtest exercises Bun-backed repositories and services against a real Postgres database, rolling back every test's outer transaction so nothing is left behind.
|
Package dbtest exercises Bun-backed repositories and services against a real Postgres database, rolling back every test's outer transaction so nothing is left behind. |
|
backend/internal/logging
Package logging builds the backend's structured slog.Logger from runtime configuration.
|
Package logging builds the backend's structured slog.Logger from runtime configuration. |
|
backend/internal/openapi
Package openapi builds the Huma API with every domain registered, over whatever infrastructure it is handed, so `gonext openapi` can produce the document with no database and no environment.
|
Package openapi builds the Huma API with every domain registered, over whatever infrastructure it is handed, so `gonext openapi` can produce the document with no database and no environment. |
|
backend/internal/presentation/api
Package api hosts the cross-cutting HTTP server bootstrap shared by all domains: the single Echo+Huma instance every domain registers onto.
|
Package api hosts the cross-cutting HTTP server bootstrap shared by all domains: the single Echo+Huma instance every domain registers onto. |
|
backend/internal/presentation/httpx
Package httpx wraps Huma's registration so handlers receive a *Ctx instead of a bare context.Context.
|
Package httpx wraps Huma's registration so handlers receive a *Ctx instead of a bare context.Context. |
|
backend/users
Package users is the public facade for the users domain.
|
Package users is the public facade for the users domain. |
|
backend/users/domain
Package domain holds the users domain's public entities, value objects, domain errors, and ports.
|
Package domain holds the users domain's public entities, value objects, domain errors, and ports. |
|
backend/users/internal/application
Package application holds the users domain's use cases.
|
Package application holds the users domain's use cases. |
|
backend/users/internal/idgen
Package idgen mints the users domain's random identifiers: user ids, one-shot token values, and session tokens.
|
Package idgen mints the users domain's random identifiers: user ids, one-shot token values, and session tokens. |
|
backend/users/internal/infrastructure/auth
Package auth adapts the users track's session issuer to gonext's published auth.Resolver contract — the default identity provider, swapped by providing a different auth.Resolver in wire.go.
|
Package auth adapts the users track's session issuer to gonext's published auth.Resolver contract — the default identity provider, swapped by providing a different auth.Resolver in wire.go. |
|
backend/users/internal/infrastructure/memory
Package memory provides in-memory adapters for the users domain's ports, so application-layer use cases can be tested without a database.
|
Package memory provides in-memory adapters for the users domain's ports, so application-layer use cases can be tested without a database. |
|
backend/users/internal/infrastructure/notify
Package notify provides Core's default domain.Notifier: one that logs instead of sending mail.
|
Package notify provides Core's default domain.Notifier: one that logs instead of sending mail. |
|
backend/users/internal/infrastructure/postgres
Package postgres provides the users domain's Postgres-backed adapters for its repository, session, and transaction ports.
|
Package postgres provides the users domain's Postgres-backed adapters for its repository, session, and transaction ports. |
|
backend/users/internal/presentation
Package presentation exposes the users domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes and owning the session cookie mechanics.
|
Package presentation exposes the users domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes and owning the session cookie mechanics. |
Click to show internal directories.
Click to hide internal directories.