xtablo-source/backend/embed.go

23 lines
786 B
Go
Raw Permalink Normal View History

// 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