type
ExecuteOption
type ExecuteOption = core.ExecuteOptionOne opaque runtime option accepted by Execute.
WithStorefunc(StoreFactory) ExecuteOption- Required in server mode. Lazily opens the singular document-store adapter.
WithProjectMigrationsfunc(migration.ProjectDriver) ExecuteOption- Registers compiled migration callbacks for project migration commands.
WithAddressfunc(string) ExecuteOption- Sets the HTTP listen address; the default is :8080.
WithHandlerOptionsfunc(HandlerOptions) ExecuteOption- Configures HTTP security, limits, embedded admin assets, workers, and observers.
WithServerOptionsfunc(ServerOptions) ExecuteOption- Configures socket bounds, readiness admission, and graceful shutdown.
WithUploadStoragefunc(StorageFactory) ExecuteOption- Lazily opens object storage for upload-enabled applications.
Applications cannot implement this type because its input is private. Use WithStore, WithProjectMigrations, WithUploadStorage, WithAddress, WithHandlerOptions, and WithServerOptions; later duplicate options replace earlier values.
ExecuteOption is intentionally opaque: application code chooses from Ridu’s public With… constructors rather than mutating the internal server state or defining custom lifecycle options.
Options are applied in argument order when Execute starts the no-argument server branch. If the same constructor is supplied more than once, the later value replaces the earlier value for that setting.
When the executable is serving a project command, Execute resolves config and returns before applying these options. Store and storage factories therefore remain untouched during schema discovery, generate, and check.
Example
options := []ridu.ExecuteOption{
ridu.WithStore(openStore),
ridu.WithProjectMigrations(projectMigrations),
ridu.WithAddress(":8080"),
ridu.WithHandlerOptions(ridu.HandlerOptions{
AdminAssets: adminassets.FS(),
}),
}
if err := ridu.Execute(content.Config(), options...); err != nil {
log.Fatal(err)
}Related types
ExecuteOptionOpaque production lifecycle option accepted by Execute.