25 lines
736 B
Go
25 lines
736 B
Go
package initialize
|
|
|
|
import (
|
|
"context"
|
|
|
|
"kra/app/system/internal/biz"
|
|
"kra/app/system/internal/conf"
|
|
|
|
"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, *biz.DatabaseConfig, func(context.Context, *gorm.DB) error) error
|
|
PersistConfig(context.Context) error
|
|
PersistAdminConfig(context.Context, []byte) error
|
|
PersistRuntimeConfig(context.Context, []byte, []byte) error
|
|
ReloadConfig(context.Context) error
|
|
RuntimeValues() (*conf.Data, *conf.AdminBackend)
|
|
RuntimeAdmin() *conf.AdminBackend
|
|
RefreshDatabaseSources(*conf.Data) error
|
|
}
|