mirror of
https://github.com/netbirdio/management-refactor.git
synced 2026-05-22 17:12:59 -07:00
20 lines
362 B
Go
20 lines
362 B
Go
package accounts
|
|
|
|
import "management/internal/shared/db"
|
|
|
|
type Repository interface {
|
|
RunInTx(fn func(tx db.Transaction) error) error
|
|
}
|
|
|
|
type repository struct {
|
|
store *db.Store
|
|
}
|
|
|
|
func newRepository(s *db.Store) Repository {
|
|
return &repository{store: s}
|
|
}
|
|
|
|
func (r *repository) RunInTx(fn func(tx db.Transaction) error) error {
|
|
return r.store.RunInTx(fn)
|
|
}
|