Combine New/Setup functions

This commit is contained in:
Michael Hohn
2024-06-16 10:31:52 -07:00
committed by =Michael Hohn
parent f611f02d1c
commit cd0647836e
8 changed files with 47 additions and 63 deletions

View File

@@ -32,13 +32,7 @@ func (s *StorageContainer) FindAvailableDBs(analysisReposRequested []common.Owne
return notFoundRepos, analysisRepos
}
func (s *StorageContainer) Setup(v *Visibles) {
// TODO XX: set up qldb_db
s.modules = v
}
func NewQLDBStore(startingID int) (*StorageContainer, error) {
func NewQLDBStore(startingID int, v *Visibles) (*StorageContainer, error) {
// TODO drop the startingID
db, err := ConnectDB(DBSpec{
Host: "postgres",
@@ -61,10 +55,13 @@ func NewQLDBStore(startingID int) (*StorageContainer, error) {
return nil, err
}
// TODO XX: set up qldb_db
s.modules = v
return &s, nil
}
func NewServerStore(startingID int) (*StorageContainer, error) {
func NewServerStore(startingID int, v *Visibles) (*StorageContainer, error) {
db, err := ConnectDB(DBSpec{
Host: "postgres",
Port: 5432,
@@ -85,6 +82,9 @@ func NewServerStore(startingID int) (*StorageContainer, error) {
return nil, err
}
// TODO XX: set up qldb_db
s.modules = v
return &s, nil
}