service

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const BuiltinContainerTemplateDir = "builtin/container_templates"

BuiltinContainerTemplateDir 是内置容器模板源码目录(相对工作目录,与内置提示词一致)。

Variables

View Source
var (
	ErrUnsupportedSheetFormat = errors.New("unsupported sheet format")
	ErrInvalidWorkbookData    = errors.New("invalid workbook data")
)
View Source
var ErrDatasetFileAlreadyAdded = stderrs.New("dataset file already added")
View Source
var ErrUserProjectActive = errors.New("user project is active")

ErrUserProjectActive indicates the user-project binding is still active and cannot be deleted.

Functions

func EnsureDefaultContainerTemplate added in v0.2.0

func EnsureDefaultContainerTemplate(ctx context.Context, containerRepo interfaces.ContainerRepository) error

EnsureDefaultContainerTemplate 在没有任何默认模板时,把库里最早的绑定行设为默认。

仅在服务启动时调用(存量数据没有默认标记,否则 create_script 无法解析默认值)。 已存在默认行时不做任何改动,因此不会覆盖用户在 UI 上的选择。

func InstallBuiltinContainerTemplates added in v0.2.0

func InstallBuiltinContainerTemplates(ctx context.Context, svc interfaces.ContainerService) error

InstallBuiltinContainerTemplates 把内置容器模板逐个导入数据库(系统启动时调用)。

读取顺序与内置提示词 / 技能一致:先读磁盘 <base>/builtin/container_templates/*.json (便于运维直接修改部署目录里的文件),目录不存在时回退到编译进二进制的内嵌副本。

每个文件是一次独立的 InstallContainerAssets(各自一个事务内按主键 upsert), 某个文件失败时记录日志并继续处理后面的文件;返回第一个错误,便于测试断言。

func NewAnalysisService

func NewAnalysisService(
	analysisRepo interfaces.AnalysisRepository,
	workflowRepo interfaces.WorkflowRepository,
	projectRepo interfaces.ProjectRepository,
	containerService interfaces.ContainerService,
	cfg *config.Config,
) interfaces.AnalysisService

func NewContainerService

func NewContainerService(containerRepo interfaces.ContainerRepository, containerMgr *manager.ContainerManager, config *config.Config) interfaces.ContainerService

func NewDataService

func NewDataService(cfg *config.Config, dataRepo interfaces.DataRepository) interfaces.DataService

func NewSheetFileService

func NewSheetFileService(cfg *config.Config) interfaces.SheetFileService

func NewStoreService

func NewStoreService(storeRepo interfaces.StoreRepository, projectService interfaces.ProjectService) interfaces.StoreService

func NewUserService

func NewUserService(
	configInfo *config.Config,
	userRepo interfaces.UserRepository,
	tokenRepo interfaces.AuthTokenRepository,

) interfaces.UserService

NewUserService creates a new user service instance

func SetBuiltinContainerTemplateDir added in v0.2.0

func SetBuiltinContainerTemplateDir(dir string)

SetBuiltinContainerTemplateDir 覆盖内置容器模板源码目录(空串表示恢复默认)。 仅用于测试或自定义部署目录;非并发安全,应在服务启动前调用。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL