ingredient/info: Add Fetcher concept
This commit is contained in:
parent
a6501b42c7
commit
52559e4d68
22 changed files with 447 additions and 328 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/meta"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/mstore"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
|
|
@ -46,3 +47,14 @@ func (drush *Drush) LastUpdate() (t time.Time, err error) {
|
|||
func (drush *Drush) setLastUpdate() error {
|
||||
return lastUpdate.Set(drush.MStore, time.Now().Unix())
|
||||
}
|
||||
|
||||
type LastUpdateFetcher struct {
|
||||
ingredient.Base
|
||||
|
||||
Drush *Drush
|
||||
}
|
||||
|
||||
func (lbr *LastUpdateFetcher) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) (err error) {
|
||||
info.LastUpdate, err = lbr.Drush.LastUpdate()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue