Add hepc integration

This commit is contained in:
Michael Hohn
2025-01-30 14:40:46 -08:00
committed by =Michael Hohn
parent 4140eaafc4
commit 23e3ea9367
3 changed files with 137 additions and 45 deletions

View File

@@ -4,11 +4,12 @@ import (
"fmt"
"log"
"log/slog"
"os"
"strconv"
"github.com/hohn/mrvacommander/pkg/artifactstore"
"github.com/hohn/mrvacommander/pkg/qldbstore"
"github.com/hohn/mrvacommander/pkg/queue"
"os"
"strconv"
)
func validateEnvVars(requiredEnvVars []string) {
@@ -94,3 +95,17 @@ func InitMinIOCodeQLDatabaseStore() (qldbstore.Store, error) {
return store, nil
}
func InitHEPCDatabaseStore() (qldbstore.Store, error) {
requiredEnvVars := []string{
"MRVA_HEPC_ENDPOINT",
"MRVA_HEPC_CACHE_DURATION",
}
validateEnvVars(requiredEnvVars)
endpoint := os.Getenv("MRVA_HEPC_ENDPOINT")
store := qldbstore.NewHepcStore(endpoint)
return store, nil
}