Code generalization: request db info from other source: remove unneccessary types
This commit is contained in:
committed by
=Michael Hohn
parent
77ce997fbb
commit
52aafd6fc9
@@ -4,26 +4,12 @@ import (
|
||||
"mrvacommander/pkg/common"
|
||||
)
|
||||
|
||||
type CodeQLDatabaseLocation struct {
|
||||
// `Data` is a map of key-value pairs that describe the location of the database.
|
||||
// For example, a simple key-value pair could be "path" -> "/path/to/database.zip".
|
||||
// A more complex implementation could be "bucket" -> "example", "key" -> "unique_identifier".
|
||||
// XX: static types
|
||||
Data map[string]string
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
// FindAvailableDBs returns a map of available databases for the requested analysisReposRequested.
|
||||
// It also returns a list of repository NWOs that do not have available databases.
|
||||
FindAvailableDBs(analysisReposRequested []common.NameWithOwner) (
|
||||
notFoundRepos []common.NameWithOwner,
|
||||
foundRepos *map[common.NameWithOwner]CodeQLDatabaseLocation)
|
||||
foundRepos []common.NameWithOwner)
|
||||
|
||||
// GetDatabase returns the database as a byte slice for the specified repository.
|
||||
// A CodeQL database is a zip archive to be processed by the CodeQL CLI.
|
||||
GetDatabase(location CodeQLDatabaseLocation) ([]byte, error)
|
||||
|
||||
// GetDatabaseByNWO returns the database location for the specified repository.
|
||||
// FindAvailableDBs should be used in lieu of this method for checking database availability.
|
||||
GetDatabaseLocationByNWO(nwo common.NameWithOwner) (CodeQLDatabaseLocation, error)
|
||||
// GetDatabase: return the database as a byte slice for the specified repository.
|
||||
// The slice is a CodeQL database -- a zip archive to be processed by the CodeQL CLI.
|
||||
GetDatabase(location common.NameWithOwner) ([]byte, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user