feat(core): add typed eventbus and domain extension points

This commit is contained in:
ryan
2026-08-27 23:47:58 +08:00
parent c53a5461ab
commit ef6296bd22
4 changed files with 140 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package contracts
import (
"context"
"gorm.io/gorm"
)
// DBService defines the standard contract for relational database access and multi-datasource routing.
type DBService interface {
// GORM returns the underlying GORM database instance.
GORM() *gorm.DB
// DB returns the GORM database instance bound to the given context.
DB(ctx context.Context) *gorm.DB
// Named returns a named database connection if multiple data sources or replicas are configured.
Named(name string) *gorm.DB
}