function
Execute
func Execute(
applicationConfig Config,
options ...ExecuteOption,
) errorRun the API, admin, jobs, and shutdown lifecycle.
With project-command arguments, Execute resolves config and runs the versioned CLI protocol without applying runtime options or opening adapters. With no arguments, it starts the framework-owned HTTP server and requires WithStore.
Server startup opens the document store, opens optional upload storage, constructs the application, verifies readiness, binds the listener, and only then starts background workers. SIGINT or SIGTERM marks readiness as draining, shuts down HTTP work, drains workers, and closes lifecycle-owned adapters.
Execute blocks until the command or server lifecycle finishes. Return its error from main or log it as a fatal startup/runtime failure.
Example
err := ridu.Execute(
content.Config(),
ridu.WithStore(func(ctx context.Context) (store.Store, error) {
return postgres.Open(ctx, os.Getenv("DATABASE_URL"))
}),
ridu.WithAddress(":8080"),
)
if err != nil {
log.Fatal(err)
}Related types
ConfigThe complete author-owned application definition.
ExecuteOptionOne opaque runtime option accepted by Execute.