This commit is contained in:
Andrey Chervyakov 2021-03-17 18:54:45 +06:00
parent e426559cec
commit ddaf0dcbfc
6 changed files with 42 additions and 40 deletions

View file

@ -24,6 +24,10 @@ type PgRepository struct {
pool *pgxpool.Pool
}
func NewRepository(pool *pgxpool.Pool) Repository {
return &PgRepository{pool: pool}
}
func (r *PgRepository) Save(link *Link) error {
ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout)
defer cancel()