aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2023-07-17 20:26:09 -0400
committerMichael Matloob <matloob@golang.org>2023-07-18 18:00:38 +0000
commitf466d5d0c7bdf6d8cb3ab8ecc7f2778fa49461ba (patch)
tree88ecb00a49ccd56696462d0d2cc672cda7351a02 /internal/postgres
parent57875e59c1fa9fcbe280b12387351393435e7e8c (diff)
downloadgo-x-pkgsite-f466d5d0c7bdf6d8cb3ab8ecc7f2778fa49461ba.tar.xz
internal: add an interface for internal/postgres.DB
And use that interface to remove the dependency from internal/frontend to internal/postgres. The dependency still exists in the test code. That will be taken care of in another CL. For #61399 Change-Id: Ic1b3c257e6eb34858cf31b7596251aaff71d3482 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/510417 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'internal/postgres')
-rw-r--r--internal/postgres/postgres.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/postgres/postgres.go b/internal/postgres/postgres.go
index d56f08c6..45de9043 100644
--- a/internal/postgres/postgres.go
+++ b/internal/postgres/postgres.go
@@ -29,6 +29,11 @@ func New(db *database.DB) *DB {
return newdb(db, false)
}
+// Used to check that a DataSource is a PostgresDB without doing a
+// direct type assertion on *DB.
+func (*DB) IsPostgresDB() {
+}
+
// NewBypassingLicenseCheck returns a new postgres DB that bypasses license
// checks. That means all data will be inserted and returned for
// non-redistributable modules, packages and directories.