- backend/embed.go: package assets with //go:embed all:static and //go:embed migrations - backend/internal/db/migrate.go: RunMigrations using pgx/v5/stdlib bridge to goose.Up() - backend/internal/web/handlers.go: HealthzHandler() no-arg liveness + ReadyzHandler(pinger) readiness - backend/internal/web/handlers_test.go: TestHealthz_OK (no pinger), TestReadyz_OK, TestReadyz_Down added; TestHealthz_Down deleted
22 lines
786 B
Go
22 lines
786 B
Go
// Package assets exposes the embedded static assets and SQL migrations that are
|
|
// baked into the binary at build time. Importing packages reference these via:
|
|
//
|
|
// import assets "backend"
|
|
//
|
|
// and then use assets.Static (for file serving) and assets.Migrations (for goose).
|
|
package assets
|
|
|
|
import "embed"
|
|
|
|
// Static holds all files under the static/ directory, embedded at build time.
|
|
// The all: prefix includes files whose names begin with . or _ (e.g. .gitkeep).
|
|
//
|
|
//go:embed all:static
|
|
var Static embed.FS
|
|
|
|
// Migrations holds all .sql files under the migrations/ directory, embedded at
|
|
// build time. goose.SetBaseFS(Migrations) + goose.Up(sqlDB, "migrations") uses
|
|
// this FS so the binary has zero runtime file dependencies.
|
|
//
|
|
//go:embed migrations
|
|
var Migrations embed.FS
|