From c1df01d11399a643a4eec6a9507e4e299bd3d898 Mon Sep 17 00:00:00 2001 From: SoXX Date: Mon, 3 Jun 2024 21:45:39 +0200 Subject: [PATCH] chore: reorganizing code Signed-off-by: SoXX --- pkg/database/{graph_impl.go => graph/graph.go} | 5 +++-- pkg/database/{postgresql_impl.go => postgres/postgres.go} | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) rename pkg/database/{graph_impl.go => graph/graph.go} (97%) rename pkg/database/{postgresql_impl.go => postgres/postgres.go} (97%) diff --git a/pkg/database/graph_impl.go b/pkg/database/graph/graph.go similarity index 97% rename from pkg/database/graph_impl.go rename to pkg/database/graph/graph.go index a48fad6..81f94a8 100644 --- a/pkg/database/graph_impl.go +++ b/pkg/database/graph/graph.go @@ -1,8 +1,9 @@ -package database +package graph import ( "context" "git.dragse.it/anthrove/otter-space-sdk/internal/graph" + "git.dragse.it/anthrove/otter-space-sdk/pkg/database" "git.dragse.it/anthrove/otter-space-sdk/pkg/models" "github.com/neo4j/neo4j-go-driver/v5/neo4j" @@ -14,7 +15,7 @@ type graphConnection struct { graphDebug bool } -func NewGraphConnection(graphDebug bool) OtterSpace { +func NewGraphConnection(graphDebug bool) database.OtterSpace { return &graphConnection{ driver: nil, graphDebug: graphDebug, diff --git a/pkg/database/postgresql_impl.go b/pkg/database/postgres/postgres.go similarity index 97% rename from pkg/database/postgresql_impl.go rename to pkg/database/postgres/postgres.go index 96e241f..bac144a 100644 --- a/pkg/database/postgresql_impl.go +++ b/pkg/database/postgres/postgres.go @@ -1,8 +1,9 @@ -package database +package postgres import ( "context" "fmt" + "git.dragse.it/anthrove/otter-space-sdk/pkg/database" "git.dragse.it/anthrove/otter-space-sdk/pkg/models" "gorm.io/driver/postgres" "gorm.io/gorm" @@ -12,7 +13,7 @@ type postgresqlConnection struct { db *gorm.DB } -func NewPostgresqlConnection() OtterSpace { +func NewPostgresqlConnection() database.OtterSpace { return &postgresqlConnection{ db: nil, }