Documentation
¶
Index ¶
- func NewAdminService(taskQueue driven.TaskQueue, schedulerStore driven.SchedulerStore, ...) driving.AdminService
- func NewAuthService(userStore driven.UserStore, sessionStore driven.SessionStore, ...) driving.AuthService
- func NewCapabilitiesService(configProvider driven.ConfigProvider, capabilityStore driven.CapabilityStore) driving.CapabilitiesService
- func NewConnectionService(cfg ConnectionServiceConfig) driving.ConnectionService
- func NewDocumentService(documentStore driven.DocumentStore, chunkStore driven.ChunkStore) driving.DocumentService
- func NewOAuthService(cfg OAuthServiceConfig) driving.OAuthService
- func NewProviderService(configProvider driven.ConfigProvider) driving.ProviderService
- func NewSearchService(searchEngine driven.SearchEngine, documentStore driven.DocumentStore, ...) driving.SearchService
- func NewSettingsService(settingsStore driven.SettingsStore, aiFactory driven.AIServiceFactory, ...) driving.SettingsService
- func NewSetupService(userStore driven.UserStore, sourceStore driven.SourceStore, teamID string) driving.SetupService
- func NewSourceService(sourceStore driven.SourceStore, documentStore driven.DocumentStore, ...) driving.SourceService
- func NewUserService(userStore driven.UserStore, sessionStore driven.SessionStore, ...) driving.UserService
- type ConnectionServiceConfig
- type OAuthServiceConfig
- type Scheduler
- func (s *Scheduler) CreateScheduledTask(ctx context.Context, scheduled *domain.ScheduledTask) error
- func (s *Scheduler) DeleteScheduledTask(ctx context.Context, id string) error
- func (s *Scheduler) DisableScheduledTask(ctx context.Context, id string) error
- func (s *Scheduler) EnableScheduledTask(ctx context.Context, id string) error
- func (s *Scheduler) GetScheduledTask(ctx context.Context, id string) (*domain.ScheduledTask, error)
- func (s *Scheduler) ListScheduledTasks(ctx context.Context, teamID string) ([]*domain.ScheduledTask, error)
- func (s *Scheduler) Start(ctx context.Context) error
- func (s *Scheduler) Stop()
- func (s *Scheduler) TriggerNow(ctx context.Context, id string) (*domain.Task, error)
- func (s *Scheduler) UpdateScheduledTask(ctx context.Context, scheduled *domain.ScheduledTask) error
- type SchedulerConfig
- type SyncOrchestrator
- func (o *SyncOrchestrator) CancelSync(ctx context.Context, sourceID string) error
- func (o *SyncOrchestrator) GetSyncState(ctx context.Context, sourceID string) (*domain.SyncState, error)
- func (o *SyncOrchestrator) ListSyncStates(ctx context.Context) ([]*domain.SyncState, error)
- func (o *SyncOrchestrator) SyncAll(ctx context.Context) ([]*domain.SyncResult, error)
- func (o *SyncOrchestrator) SyncSource(ctx context.Context, sourceID string) (*domain.SyncResult, error)
- type SyncOrchestratorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdminService ¶
func NewAdminService( taskQueue driven.TaskQueue, schedulerStore driven.SchedulerStore, searchQueryRepository driven.SearchQueryRepository, sourceStore driven.SourceStore, ) driving.AdminService
NewAdminService creates a new AdminService
func NewAuthService ¶
func NewAuthService( userStore driven.UserStore, sessionStore driven.SessionStore, authAdapter driven.AuthAdapter, ) driving.AuthService
NewAuthService creates a new AuthService
func NewCapabilitiesService ¶
func NewCapabilitiesService( configProvider driven.ConfigProvider, capabilityStore driven.CapabilityStore, ) driving.CapabilitiesService
NewCapabilitiesService creates a new CapabilitiesService.
func NewConnectionService ¶
func NewConnectionService(cfg ConnectionServiceConfig) driving.ConnectionService
NewConnectionService creates a new connection service.
func NewDocumentService ¶
func NewDocumentService( documentStore driven.DocumentStore, chunkStore driven.ChunkStore, ) driving.DocumentService
NewDocumentService creates a new DocumentService
func NewOAuthService ¶
func NewOAuthService(cfg OAuthServiceConfig) driving.OAuthService
NewOAuthService creates a new OAuth service.
func NewProviderService ¶
func NewProviderService(configProvider driven.ConfigProvider) driving.ProviderService
NewProviderService creates a new ProviderService.
func NewSearchService ¶
func NewSearchService( searchEngine driven.SearchEngine, documentStore driven.DocumentStore, services *runtime.Services, searchExecutor pipelineport.SearchExecutor, capabilityStore driven.CapabilityStore, settingsStore driven.SettingsStore, teamID string, ) driving.SearchService
NewSearchService creates a new SearchService AI services (embedding, LLM) are accessed dynamically via runtime.Services
func NewSettingsService ¶
func NewSettingsService( settingsStore driven.SettingsStore, aiFactory driven.AIServiceFactory, configProvider driven.ConfigProvider, services *runtime.Services, teamID string, ) driving.SettingsService
NewSettingsService creates a new SettingsService
func NewSetupService ¶
func NewSetupService( userStore driven.UserStore, sourceStore driven.SourceStore, teamID string, ) driving.SetupService
NewSetupService creates a new SetupService
func NewSourceService ¶
func NewSourceService( sourceStore driven.SourceStore, documentStore driven.DocumentStore, syncStore driven.SyncStateStore, searchEngine driven.SearchEngine, ) driving.SourceService
NewSourceService creates a new SourceService
func NewUserService ¶
func NewUserService( userStore driven.UserStore, sessionStore driven.SessionStore, authAdapter driven.AuthAdapter, teamID string, ) driving.UserService
NewUserService creates a new UserService
Types ¶
type ConnectionServiceConfig ¶
type ConnectionServiceConfig struct {
// ConnectionStore manages connection persistence.
ConnectionStore driven.ConnectionStore
// SourceStore manages source persistence (for checking usage).
SourceStore driven.SourceStore
// ContainerListerFactory creates container listers for providers.
ContainerListerFactory driven.ContainerListerFactory
// TokenProviderFactory creates token providers for testing connections.
TokenProviderFactory driven.TokenProviderFactory
}
ConnectionServiceConfig holds configuration for the connection service.
type OAuthServiceConfig ¶
type OAuthServiceConfig struct {
// ConfigProvider retrieves OAuth app credentials from environment variables.
ConfigProvider driven.ConfigProvider
// OAuthStateStore manages OAuth flow state.
OAuthStateStore driven.OAuthStateStore
// ConnectionStore persists connector installations.
ConnectionStore driven.ConnectionStore
// OAuthHandlerFactory provides OAuth handlers per provider.
// Port interface - abstracts connector factory.
OAuthHandlerFactory driven.OAuthHandlerFactory
}
OAuthServiceConfig holds configuration for the OAuth service.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages periodic task scheduling. It runs on worker nodes and enqueues tasks based on schedules.
For multi-worker deployments, configure a DistributedLock to prevent duplicate task enqueuing across instances.
func NewScheduler ¶
func NewScheduler(cfg SchedulerConfig) *Scheduler
NewScheduler creates a new scheduler.
func (*Scheduler) CreateScheduledTask ¶
CreateScheduledTask creates a new scheduled task.
func (*Scheduler) DeleteScheduledTask ¶
DeleteScheduledTask deletes a scheduled task.
func (*Scheduler) DisableScheduledTask ¶
DisableScheduledTask disables a scheduled task.
func (*Scheduler) EnableScheduledTask ¶
EnableScheduledTask enables a scheduled task.
func (*Scheduler) GetScheduledTask ¶
GetScheduledTask retrieves a scheduled task by ID.
func (*Scheduler) ListScheduledTasks ¶
func (s *Scheduler) ListScheduledTasks(ctx context.Context, teamID string) ([]*domain.ScheduledTask, error)
ListScheduledTasks lists all scheduled tasks for a team.
func (*Scheduler) Start ¶
Start begins the scheduler loop. It runs until Stop is called or context is cancelled.
func (*Scheduler) TriggerNow ¶
TriggerNow immediately enqueues a scheduled task (ignoring schedule).
func (*Scheduler) UpdateScheduledTask ¶
UpdateScheduledTask updates a scheduled task.
type SchedulerConfig ¶
type SchedulerConfig struct {
Store driven.SchedulerStore
TaskQueue driven.TaskQueue
Lock driven.DistributedLock // Optional: distributed lock for multi-instance coordination
Logger *slog.Logger
PollInterval time.Duration // How often to check for due tasks (default: 30s)
LockTTL time.Duration // TTL for the distributed lock (default: 60s)
LockRequired bool // If true, skip scheduling when lock cannot be acquired (default: true)
}
SchedulerConfig holds configuration for the scheduler.
type SyncOrchestrator ¶
type SyncOrchestrator struct {
// contains filtered or unexported fields
}
SyncOrchestrator coordinates the document sync pipeline. It implements the 7-step sync flow:
- Get source config
- Create connector
- Validate connector
- Get sync state (cursor for incremental sync)
- Fetch documents
- Process each document (normalise → chunk → embed → store → index)
- Update sync cursor
func NewSyncOrchestrator ¶
func NewSyncOrchestrator(cfg SyncOrchestratorConfig) *SyncOrchestrator
NewSyncOrchestrator creates a new sync orchestrator.
func (*SyncOrchestrator) CancelSync ¶
func (o *SyncOrchestrator) CancelSync(ctx context.Context, sourceID string) error
CancelSync cancels an ongoing sync for a source. Note: This is a placeholder - actual cancellation requires context propagation.
func (*SyncOrchestrator) GetSyncState ¶
func (o *SyncOrchestrator) GetSyncState(ctx context.Context, sourceID string) (*domain.SyncState, error)
GetSyncState retrieves the sync state for a source.
func (*SyncOrchestrator) ListSyncStates ¶
ListSyncStates retrieves sync states for all sources.
func (*SyncOrchestrator) SyncAll ¶
func (o *SyncOrchestrator) SyncAll(ctx context.Context) ([]*domain.SyncResult, error)
SyncAll synchronizes all enabled sources for a team.
func (*SyncOrchestrator) SyncSource ¶
func (o *SyncOrchestrator) SyncSource(ctx context.Context, sourceID string) (*domain.SyncResult, error)
SyncSource synchronizes a single source. This is the main entry point for the sync pipeline. For sources with container selection, it syncs each selected container.
type SyncOrchestratorConfig ¶
type SyncOrchestratorConfig struct {
SourceStore driven.SourceStore
DocumentStore driven.DocumentStore
ChunkStore driven.ChunkStore
SyncStore driven.SyncStateStore
SearchEngine driven.SearchEngine
VectorIndex driven.VectorIndex
ConnectorFactory driven.ConnectorFactory
NormaliserReg driven.NormaliserRegistry
Services *runtime.Services
Logger *slog.Logger
IndexingExecutor pipelineport.IndexingExecutor // Required pipeline executor
CapabilitySet *pipeline.CapabilitySet // Capabilities for pipeline
CapabilityStore driven.CapabilityStore // For fetching capability preferences
SettingsStore driven.SettingsStore // For loading team settings
TeamID string // Team ID for settings lookup
}
SyncOrchestratorConfig holds dependencies for SyncOrchestrator.