mirror of
https://github.com/hay-kot/homebox.git
synced 2025-05-23 21:52:32 +00:00
Initial commit
This commit is contained in:
commit
29f583e936
135 changed files with 18463 additions and 0 deletions
22
backend/internal/mocks/mocks_ent_repo.go
Normal file
22
backend/internal/mocks/mocks_ent_repo.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hay-kot/git-web-template/backend/ent"
|
||||
"github.com/hay-kot/git-web-template/backend/internal/repo"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func GetEntRepos() (*repo.AllRepos, func() error) {
|
||||
c, err := ent.Open("sqlite3", "file:ent?mode=memory&cache=shared&_fk=1")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := c.Schema.Create(context.Background()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return repo.EntAllRepos(c), c.Close
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue