wisski-cloud-distillery/internal/wisski/ingredient/info/snapshots.go
Tom Wiesing 8235ea9105
Require access to Still via method
This commit adds a safeguard to accessing the still from a specific
component by requiring access via the component.GetStill method.
2024-04-08 22:39:32 +02:00

23 lines
478 B
Go

package info
import (
"github.com/FAU-CDI/wisski-distillery/internal/status"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
)
type SnapshotsFetcher struct {
ingredient.Base
}
var (
_ ingredient.WissKIFetcher = (*SnapshotsFetcher)(nil)
)
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
if flags.Quick {
return
}
info.Snapshots, _ = ingredient.GetLiquid(lbr).Snapshots(flags.Context)
return
}