schemaf

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetProjectName added in v0.3.1

func SetProjectName(name string)

SetProjectName is called from the generated constants.gen.go to register the project name at init time, before New is called.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is a configured schemaf application. Use New to create one.

func New

func New(ctx context.Context) *App

New creates a new App using the project name registered via SetProjectName. The project name determines the database name, host, and migration prefix.

func (*App) AddApi

func (a *App) AddApi(provider func())

AddApi registers all API endpoints by calling the generated provider function. Wire up in go/main.go: app.AddApi(api.Provider)

func (*App) AddDb

func (a *App) AddDb(provider func() embed.FS)

AddDb registers the project's database migrations. Wire up in go/main.go: app.AddDb(db.Provider)

func (*App) AddSubcommand added in v0.2.0

func (a *App) AddSubcommand(provider cli.SubcommandProvider)

AddSubcommand registers a subcommand provider. Providers follow the same pattern as framework CLI subcommands (see cli/cmd/* for examples). Wire up in go/main.go: app.AddSubcommand(importer.SubcommandProvider)

func (*App) Run

func (a *App) Run() error

Run hands over to Cobra for command routing. The "server" command (default when no subcommand is given) starts the HTTP server. Custom subcommands registered via AddSubcommand are mounted alongside it.

Jump to

Keyboard shortcuts

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