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 barrel
|
||||
|
||||
import "github.com/tkw1536/goprogram/stream"
|
||||
import (
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
// Running checks if this WissKI is currently running.
|
||||
func (barrel *Barrel) Running() (bool, error) {
|
||||
|
|
@ -10,3 +13,14 @@ func (barrel *Barrel) Running() (bool, error) {
|
|||
}
|
||||
return len(ps) > 0, nil
|
||||
}
|
||||
|
||||
type RunningFetcher struct {
|
||||
ingredient.Base
|
||||
|
||||
Barrel *Barrel
|
||||
}
|
||||
|
||||
func (rf *RunningFetcher) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) (err error) {
|
||||
info.Running, err = rf.Barrel.Running()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue