init

package
v0.0.0-...-6320ad3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceContainer

type ServiceContainer struct {
	// Database connections
	MySQLConn *db.MySQLConnection

	// Core services
	CodeGraph      *codegraph.CodeGraph
	VectorDB       vector.VectorDatabase
	EmbeddingModel vector.EmbeddingModel
	ChunkService   *vector.CodeChunkService
	RepoService    *service.RepoService

	// Summary services
	LLMService       llm.LLMService
	PromptManager    *summary.PromptManager
	SummaryProcessor *controller.SummaryProcessor // Exposed for on-demand generation

	// Processors
	Processors []controller.FileProcessor
	// contains filtered or unexported fields
}

ServiceContainer holds all initialized services and their lifecycle management

func NewServiceContainer

func NewServiceContainer(cfg *config.Config, opts ServiceInitOptions, logger *zap.Logger) (*ServiceContainer, error)

NewServiceContainer initializes all requested services based on options

func (*ServiceContainer) Close

func (sc *ServiceContainer) Close(ctx context.Context)

Close cleans up all resources

func (*ServiceContainer) InitProcessors

func (sc *ServiceContainer) InitProcessors(cfg *config.Config) error

InitProcessors creates FileProcessor instances based on enabled services

type ServiceInitOptions

type ServiceInitOptions struct {
	EnableMySQL       bool
	EnableCodeGraph   bool
	EnableEmbeddings  bool
	EnableRepoService bool
	EnableSummary     bool // Enable hierarchical code summarization

	// For index building CLI mode
	RequireMySQL bool // If true, fail if MySQL is not available
}

ServiceInitOptions configures which services to initialize

func GetIndexBuildingOptions

func GetIndexBuildingOptions(cfg *config.Config) ServiceInitOptions

GetIndexBuildingOptions returns ServiceInitOptions configured for index building CLI

func GetServerModeOptions

func GetServerModeOptions(cfg *config.Config) ServiceInitOptions

GetServerModeOptions returns ServiceInitOptions configured for server mode

Jump to

Keyboard shortcuts

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