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
55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package server
|
|
|
|
import (
|
|
"mrvacommander/pkg/common"
|
|
"mrvacommander/pkg/logger"
|
|
"mrvacommander/pkg/queue"
|
|
"mrvacommander/pkg/storage"
|
|
)
|
|
|
|
type SessionInfo struct {
|
|
ID int
|
|
Owner string
|
|
ControllerRepo string
|
|
|
|
QueryPack string
|
|
Language string
|
|
Repositories []common.OwnerRepo
|
|
|
|
AccessMismatchRepos []common.OwnerRepo
|
|
NotFoundRepos []common.OwnerRepo
|
|
NoCodeqlDBRepos []common.OwnerRepo
|
|
OverLimitRepos []common.OwnerRepo
|
|
|
|
AnalysisRepos *map[common.OwnerRepo]storage.DBLocation
|
|
}
|
|
|
|
type CommanderSingle struct {
|
|
st *CommanderVisibles
|
|
// TODO remove:
|
|
queue queue.Queue
|
|
}
|
|
|
|
func NewCommanderSingle(s *CommanderVisibles, q queue.Queue) *CommanderSingle {
|
|
c := CommanderSingle{s, q}
|
|
return &c
|
|
}
|
|
|
|
// type State struct {
|
|
// Commander Commander
|
|
// Logger logger.Logger
|
|
// Queue queue.Queue
|
|
// Storage storage.Storage
|
|
// Runner agent.Runner
|
|
// }
|
|
|
|
type CommanderVisibles struct {
|
|
Logger logger.Logger
|
|
Queue queue.Queue
|
|
ServerStore storage.Storage
|
|
// TODO extra package for query pack storage
|
|
QueryPackStore storage.Storage
|
|
// TODO extra package for ql db storage
|
|
QLDBStore storage.Storage
|
|
}
|