mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 06:16:37 +08:00
43dc97e48c
- Moved cmd/, core/, plugins/, pkg/, downstream/, and main.go into backend/ directory - Batch updated all Go source files to import github.com/Rain-kl/Wavelet/backend/... - Updated Makefile, scripts/swagger.sh, architecture guards, and platform skills - Passed all quality gates (100% tests, 0 lint issues, clean build)
24 lines
665 B
Go
24 lines
665 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Package contracts defines unified service interfaces and DTOs for cross-plugin communication.
|
|
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
|
|
}
|