core

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

@index Shared runtime wiring for ccg CLI and ccg-server binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWalkers

func BuildWalkers(logger *slog.Logger) map[string]*treesitter.Walker

BuildWalkers constructs the language parser registry keyed by file extension. @intent register supported language walkers for build, update, and MCP execution paths.

Types

type Runtime

type Runtime struct {
	Logger        *slog.Logger
	DB            *gorm.DB
	Store         store.GraphStore
	SearchBackend search.Backend
	Walkers       map[string]*treesitter.Walker
	Syncer        *incremental.Syncer
}

Runtime holds shared graph, DB, parser, and search dependencies. @intent provide one dependency assembly path for local CLI and self-hosted server binaries. @sideEffect Init opens a database connection and Close closes parser/database resources.

func NewRuntime

func NewRuntime(logger *slog.Logger) *Runtime

NewRuntime creates shared runtime dependencies that do not require the database yet. @intent initialize parser walkers once before command-specific database setup runs.

func (*Runtime) Close

func (r *Runtime) Close()

Close releases parser and database resources owned by the runtime. @intent give both binaries one cleanup path for shared dependencies. @sideEffect closes Tree-sitter parsers and the active DB connection.

func (*Runtime) Init

func (r *Runtime) Init(driver, dsn string) error

Init opens the configured DB and attaches store/search/incremental services to the runtime. @intent keep schema validation and graph storage wiring identical across ccg and ccg-server. @sideEffect opens a database connection and may run safe local schema initialization.

func (*Runtime) Migrate

func (r *Runtime) Migrate(driver, dsn, migrationsDir string) error

Migrate runs application migrations for the provided database settings. @intent expose migration execution without coupling binaries to migration internals. @sideEffect modifies the target database schema.

Jump to

Keyboard shortcuts

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