21 lines
572 B
Go
21 lines
572 B
Go
package initialize
|
|
|
|
import (
|
|
"context"
|
|
"kra/internal/biz/system"
|
|
"kra/internal/config"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// Backend is the infrastructure boundary required by application
|
|
// initialization and runtime configuration management.
|
|
type Backend interface {
|
|
IsInitialized(context.Context) (bool, error)
|
|
InitializeDatabase(context.Context, *system.DatabaseConfig, func(context.Context, *gorm.DB) error) error
|
|
PersistConfig(context.Context) error
|
|
PersistRuntimeConfig(context.Context, *config.Config) error
|
|
ReloadConfig(context.Context) error
|
|
Config() *config.Config
|
|
}
|