Skip to content

EN Plugins

Andrewkydev edited this page Aug 25, 2026 · 2 revisions

Plugins

Русский: RU-Plugins

A plugin is a compile-time module with a manifest and lifecycle.

Phase Behavior
Registration manifest, defaults, schema, migrations, and extensions
Runtime begin freeze the enabled plugin snapshot
Settings load and validate durable values
Migrations run enabled plugins' Up migrations sequentially
Init(app) registration order
Start(ctx) registration order
Stop(ctx) reverse order

If Init or Start fails, plugins that have already been prepared are stopped. Registering, enabling, or disabling plugins during runtime returns plugin.ErrPluginLifecycleActive.

Optional contracts

  • ManifestProvider
  • Configurable and SettingsSchemaProvider
  • Migratable
  • AdminPermissionProvider
  • AdminModuleProvider
  • AdminUIProvider and AdminUIOperationProvider
  • AdminOperationProvider
app.PluginSettings(plugin.NewFileSettingsStore(".astraengine/settings.json"))
app.PluginMigrations(migrationStore)

With the standard Store, you can call AutoPluginSettingsFromStorage() and AutoPluginMigrationsFromStorage().

Migration Up and Down callbacks must be idempotent. The PostgreSQL-backed session migration store coordinates concurrent application instances with an advisory lock, but a process can still stop after Up succeeds and before its applied marker is committed.

Plugins do not have dependency graphs, version negotiation, or dynamic loading. The built-in auth, roles, and broadcast plugins are integration baselines, not production-ready modules.

Clone this wiki locally