Files
summercms/pact/capabilities.go
Jakub Zych d0d845052b feat(03-01): add shared postgres pool and plugin migrations
Open one pgx stdlib *sql.DB, hand it to GORM, and run per-plugin
gormigrate sets with isolated history tables after an ICU pl-PL check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 19:55:33 +02:00

53 lines
1.4 KiB
Go

package pact
import (
"io/fs"
"git.golem15.com/golem15/summercms/bonfire"
"github.com/go-gormigrate/gormigrate/v2"
)
// HasCommands is implemented by plugins that register console commands.
type HasCommands interface {
Commands() []bonfire.Command
}
// HasConfig is implemented by plugins that ship default YAML configuration.
// ConfigFS should contain files such as config/config.yaml, merged later at
// the plugin ID path.
type HasConfig interface {
ConfigFS() fs.FS
}
// HasMigrations is implemented by plugins that ship an ordered gormigrate
// set. The kernel runs each set in party.Activate order with a separate
// history table per plugin ID.
type HasMigrations interface {
Migrations() []*gormigrate.Migration
}
// OptionalMessage is a service an optional plugin may publish so other
// plugins can integrate without importing that plugin's package.
type OptionalMessage interface {
Message() string
}
// Future capability families are type-asserted when their first consumer
// packages exist. Method payloads for HTTP/model surfaces are declared in
// the phase that ships surf:
//
// HasModels
// HasRoutes
// HasMiddleware
// HasJobs
// HasListeners
// HasAdminControllers
// HasNavigation
// HasPermissions
// HasSchedule
// HasMailTemplates
// HasLang
//
// The kernel type-asserts HasConfig (party, before Register), HasCommands
// (generated app main, after Boot), and HasMigrations (lagoon migrate).