container

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0, MIT Imports: 109 Imported by: 0

Documentation

Overview

Package container - background-work wiring.

Package container implements dependency injection container setup Provides centralized configuration for services, repositories, and handlers This package is responsible for wiring up all dependencies and ensuring proper lifecycle management

Package container - workspace sandbox provider wiring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainer

func BuildContainer(container *dig.Container) *dig.Container

BuildContainer constructs the dependency injection container Registers all components, services, repositories and handlers needed by the application Creates a fully configured application container with proper dependency resolution Parameters:

  • container: Base dig container to add dependencies to

Returns:

  • Configured container with all application dependencies registered

func NewDuckDB

func NewDuckDB() (*sql.DB, error)

func NewEngineFactory

func NewEngineFactory(db *gorm.DB, cfg *config.Config, auditSvc interfaces.AuditLogService) interfaces.EngineFactory

NewEngineFactory returns an EngineFactory function closed over db, cfg, and an audit sink (built from the AuditLogService). Registered in dig and injected into VectorStoreService for dynamic registry updates. The EngineFactory type itself is unchanged — the audit sink is captured in the closure rather than added to the signature.

func NewResourceCleaner

func NewResourceCleaner() interfaces.ResourceCleaner

NewResourceCleaner creates a new resource cleaner

Types

type HostApprovalModeLoader

type HostApprovalModeLoader func() string

HostApprovalModeLoader reads the desktop approval-mode preference. Nil (server binaries, tests that do not decorate) means ModeAuto.

type HostProjectDirsLoader

type HostProjectDirsLoader = session.HostProjectDirsLoader

HostProjectDirsLoader is the approved-directory list from desktop prefs. Alias of the session-handler type so dig has one provider for both.

type ResourceCleaner

type ResourceCleaner struct {
	// contains filtered or unexported fields
}

ResourceCleaner is a resource cleaner that can be used to clean up resources

func (*ResourceCleaner) Cleanup

func (c *ResourceCleaner) Cleanup(ctx context.Context) (errs []error)

Cleanup executes all cleanup functions. A cancelled or expired context does not skip remaining functions: the deadline used to return on the first select and drop every later hook, including ones registered earliest (BrowserSkill). Context errors are not reported as hook failures when the hooks themselves still ran.

func (*ResourceCleaner) Promote

func (c *ResourceCleaner) Promote(name string)

Promote moves every callback registered under name to the end of the list. Cleanup runs in reverse, so the promoted callbacks run first. BrowserSkill is registered during early container wiring and would otherwise run last, after hooks that wait on in-flight jobs.

func (*ResourceCleaner) Register

func (c *ResourceCleaner) Register(cleanup types.CleanupFunc)

Register registers a cleanup function. The cleanup function runs in reverse order (the last registered runs first).

func (*ResourceCleaner) RegisterWithName

func (c *ResourceCleaner) RegisterWithName(name string, cleanup types.CleanupFunc)

RegisterWithName registers a cleanup function with a name, for logging tracking.

func (*ResourceCleaner) Reset

func (c *ResourceCleaner) Reset()

Reset clears all registered cleanup functions

Jump to

Keyboard shortcuts

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