This commit adds and passes context around to (almost) every function. This allows cancelling (almost) every function call globally.
23 lines
540 B
Go
23 lines
540 B
Go
package ingredient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/FAU-CDI/wisski-distillery/internal/phpx"
|
|
"github.com/FAU-CDI/wisski-distillery/internal/status"
|
|
)
|
|
|
|
type WissKIFetcher interface {
|
|
Ingredient
|
|
|
|
// Fetch fetches information from this ingredient and writes it into target.
|
|
// Distinct WissKIFetchers must write into distinct fields.
|
|
Fetch(flags FetcherFlags, target *status.WissKI) error
|
|
}
|
|
|
|
// FetcherFlags describes options for a WissKIFetcher
|
|
type FetcherFlags struct {
|
|
Context context.Context
|
|
Quick bool
|
|
Server *phpx.Server
|
|
}
|