21 lines
462 B
Go
21 lines
462 B
Go
// repository.go defines the Postgres repository shell and constructor.
|
|
// Layer: adapters/outbound/postgres repository root.
|
|
package postgres
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
"gitea.maximumdirect.net/ejr/weatherapi/internal/app"
|
|
)
|
|
|
|
// Repository is a Postgres-backed implementation of weatherapi read ports.
|
|
type Repository struct {
|
|
db *sql.DB
|
|
}
|
|
|
|
var _ app.Repository = (*Repository)(nil)
|
|
|
|
func NewRepository(db *sql.DB) *Repository {
|
|
return &Repository{db: db}
|
|
}
|