initial file store
Generate check / check-changes (pull_request) Successful in 20s
Quality / check-changes (pull_request) Successful in 34s
Generate check / verify-generate (pull_request) Has been skipped
Quality / run-tests (pull_request) Successful in 31s

This commit is contained in:
2026-07-12 07:56:52 +01:00
parent 4fc5cd22ea
commit d2b2f934a0
2 changed files with 30 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
package internal
import (
"fmt"
"os"
)
// FileStore loads and saves the state into a file
type FileStore struct {
file *os.File
}
func NewFileStore(filename string) (*FileStore, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
return &FileStore{
file: f,
}, nil
}
func (fs *FileStore) Load() (map[string]*FillerQueue, error) {
return nil, fmt.Errorf("not implemented")
}
func (fs *FileStore) Save(map[string]*FillerQueue) error {
return fmt.Errorf("not implemented")
}
+1 -3
View File
@@ -148,8 +148,6 @@ func BuildReport(ctx context.Context, reader RecordReader, writer ReportWriter,
}
}
}
return nil
}
// processRecord either adds buys to the queue or consumes buys from the queue when processing a
@@ -186,7 +184,7 @@ func processRecord(ctx context.Context, q *FillerQueue, rec Record, sel Selector
return ErrInsufficientBoughtVolume
}
// Since we don't apply selectors while processing buys we need to apply them here, befre we
// Since we don't apply selectors while processing buys we need to apply them here, before we
// actually use them.
if !sel(buy) {
continue