wip: Make cross-module visibility explicit via Visibles structs

All access is/will be through interfaces accessed through these structs.

This introduces several distinct storage units:
+ DB for server state
+ DB for codeql databases
+ query pack store

The steps for manually creating needed databases are in the README
This commit is contained in:
Michael Hohn
2024-06-07 13:14:41 -07:00
committed by =Michael Hohn
parent 25cab583c1
commit 7e0d6909da
10 changed files with 205 additions and 56 deletions

View File

@@ -2,6 +2,7 @@ package agent
import (
"mrvacommander/pkg/common"
"mrvacommander/pkg/logger"
"mrvacommander/pkg/queue"
"mrvacommander/pkg/storage"
@@ -31,6 +32,19 @@ func NewRunnerSingle(numWorkers int, queue queue.Queue) *RunnerSingle {
return &r
}
type RunnerVisibles struct {
Logger logger.Logger
Queue queue.Queue
// TODO extra package for query pack storage
QueryPackStore storage.Storage
// TODO extra package for ql db storage
QLDBStore storage.Storage
}
func (c *RunnerSingle) Setup(st *RunnerVisibles) {
return
}
func (r *RunnerSingle) worker(wid int) {
var job common.AnalyzeJob