ingredient/info: Add Fetcher concept
This commit is contained in:
parent
a6501b42c7
commit
52559e4d68
22 changed files with 447 additions and 328 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package locker
|
||||
|
||||
import "github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||
import (
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
)
|
||||
|
||||
// Locked checks if this WissKI is currently locked.
|
||||
func (lock *Locker) Locked() (locked bool) {
|
||||
|
|
@ -13,3 +16,8 @@ func (lock *Locker) Locked() (locked bool) {
|
|||
table.Select("count(*) > 0").Where("slug = ?", lock.Slug).Find(&locked)
|
||||
return
|
||||
}
|
||||
|
||||
func (locker *Locker) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) (err error) {
|
||||
info.Locked = locker.Locked()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue