Documentation
¶
Overview ¶
Package app wires platforms, routing, middleware, plugins and storage into a runtime.
Index ¶
- type App
- func (a *App) AppMigrations(m ...plugin.Migration)
- func (a *App) AutoPluginMigrationsFromStorage()
- func (a *App) AutoPluginSettingsFromStorage()
- func (a *App) Cache(c cache.Cache)
- func (a *App) CacheStore() cache.Cache
- func (a *App) Callback(pattern string, h middleware.Handler)
- func (a *App) Command(name string, h middleware.Handler)
- func (a *App) CoreMigrations(m ...plugin.Migration)
- func (a *App) Dispatch(ctx context.Context, ev event.Event) error
- func (a *App) FSM(manager *fsm.Manager) *fsm.Manager
- func (a *App) Fallback(h middleware.Handler)
- func (a *App) Group(m ...middleware.Middleware) *Group
- func (a *App) Match(re *regexp.Regexp, h middleware.Handler)
- func (a *App) Message(h middleware.Handler)
- func (a *App) MigrateDown(ctx context.Context, steps int) (int, error)
- func (a *App) MigrateUp(ctx context.Context) (MigrationReport, error)
- func (a *App) MigrationPlan() []RuntimeMigration
- func (a *App) MigrationStatus(ctx context.Context) ([]MigrationStatus, error)
- func (a *App) Platform(p platform.Platform)
- func (a *App) Plugin(p plugin.Plugin) error
- func (a *App) PluginMigrations(store plugin.MigrationStateStore)
- func (a *App) PluginSettings(store plugin.SettingsStateStore)
- func (a *App) Plugins() *plugin.Registry
- func (a *App) RateLimit(rule ratelimit.Rule)
- func (a *App) Start(ctx context.Context) error
- func (a *App) Storage(store storage.Store)
- func (a *App) Store() storage.Store
- func (a *App) Text(text string, h middleware.Handler)
- func (a *App) Use(m middleware.Middleware)
- type Group
- func (g *Group) Callback(pattern string, h middleware.Handler)
- func (g *Group) Command(name string, h middleware.Handler)
- func (g *Group) Fallback(h middleware.Handler)
- func (g *Group) Match(re *regexp.Regexp, h middleware.Handler)
- func (g *Group) Message(h middleware.Handler)
- func (g *Group) Text(text string, h middleware.Handler)
- func (g *Group) Use(m middleware.Middleware)
- type MigrationReport
- type MigrationStatus
- type RuntimeMigration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Name string
Router *router.Router
Logger *slog.Logger
// contains filtered or unexported fields
}
App is the central AstraEngine runtime and registration surface.
func (*App) AppMigrations ¶
func (*App) AutoPluginMigrationsFromStorage ¶
func (a *App) AutoPluginMigrationsFromStorage()
func (*App) AutoPluginSettingsFromStorage ¶
func (a *App) AutoPluginSettingsFromStorage()
func (*App) CacheStore ¶
CacheStore returns the configured cache.
func (*App) CoreMigrations ¶
func (*App) Dispatch ¶
Dispatch routes a normalized event through its registered platform and handlers.
func (*App) FSM ¶
FSM injects centralized FSM manager middleware for all handlers. If manager is nil, a default in-memory user-scoped manager is created.
func (*App) Fallback ¶
func (a *App) Fallback(h middleware.Handler)
func (*App) Group ¶
func (a *App) Group(m ...middleware.Middleware) *Group
Group creates a route group with shared middleware.
func (*App) Message ¶
func (a *App) Message(h middleware.Handler)
func (*App) MigrationPlan ¶
func (a *App) MigrationPlan() []RuntimeMigration
func (*App) MigrationStatus ¶
func (a *App) MigrationStatus(ctx context.Context) ([]MigrationStatus, error)
func (*App) PluginMigrations ¶
func (a *App) PluginMigrations(store plugin.MigrationStateStore)
func (*App) PluginSettings ¶
func (a *App) PluginSettings(store plugin.SettingsStateStore)
func (*App) RateLimit ¶
RateLimit adds a centralized rate-limit rule. The first call initializes and injects a shared limiter middleware.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group registers routes with an additional shared middleware chain.
func (*Group) Fallback ¶
func (g *Group) Fallback(h middleware.Handler)
func (*Group) Message ¶
func (g *Group) Message(h middleware.Handler)
func (*Group) Use ¶
func (g *Group) Use(m middleware.Middleware)