Remove workspace state subsystem
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/collect"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/config"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/facts"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/fileutil"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/forecast"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/module"
|
||||
"gitea.maximumdirect.net/eric/weatherreporter/internal/promptdebug"
|
||||
@@ -66,11 +65,6 @@ type BatchRequest struct {
|
||||
Notifier Notifier
|
||||
}
|
||||
|
||||
type FetchBundleRequest struct {
|
||||
Config config.Config
|
||||
OutputPath string
|
||||
}
|
||||
|
||||
type ModuleSnapshotRequest struct {
|
||||
Config config.Config
|
||||
Resolved report.Resolved
|
||||
@@ -568,14 +562,6 @@ func reportRegistry(cfg config.Config) (report.Registry, error) {
|
||||
return registry, nil
|
||||
}
|
||||
|
||||
func FetchBundle(ctx context.Context, req FetchBundleRequest) (*weatherdata.Bundle, error) {
|
||||
result, err := collectWeather(ctx, req.Config, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.Bundle, nil
|
||||
}
|
||||
|
||||
func collectWeather(ctx context.Context, cfg config.Config, collector Collector) (*collect.Result, error) {
|
||||
if collector == nil {
|
||||
collector = defaultCollector{}
|
||||
@@ -593,20 +579,6 @@ func collectWeather(ctx context.Context, cfg config.Config, collector Collector)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func FetchAndSaveBundle(ctx context.Context, req FetchBundleRequest) (*weatherdata.Bundle, error) {
|
||||
if req.OutputPath == "" {
|
||||
return nil, fmt.Errorf("output path is required")
|
||||
}
|
||||
bundle, err := FetchBundle(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := fileutil.WriteJSONAtomic(req.OutputPath, bundle); err != nil {
|
||||
return nil, fmt.Errorf("save bundle: %w", err)
|
||||
}
|
||||
return bundle, nil
|
||||
}
|
||||
|
||||
func notifyReport(ctx context.Context, cfg config.Config, resolved report.Resolved, outputPath, runID string, generatedAt time.Time, notifier Notifier) (*NotificationResult, error) {
|
||||
notifier, enabled := reportNotifier(cfg, notifier)
|
||||
if !enabled {
|
||||
|
||||
Reference in New Issue
Block a user