iris/_examples/project/user/repository.go

15 lines
269 B
Go
Raw Normal View History

package user
2022-04-09 13:51:34 +02:00
import "github.com/username/project/pkg/database"
type Repository interface { // Repo methods here...
}
type repo struct { // Hold database instance here: e.g.
2022-04-09 13:51:34 +02:00
db *database.DB
}
2022-04-09 13:51:34 +02:00
func NewRepository(db *database.DB) Repository {
return &repo{db: db}
}