GenerateAndWritePredicate generates a Predicate and writes it to a file, returning the written path.
(ctx context.Context, generator *Generator, writer *Writer)
| 25 | |
| 26 | // GenerateAndWritePredicate generates a Predicate and writes it to a file, returning the written path. |
| 27 | func GenerateAndWritePredicate(ctx context.Context, generator *Generator, writer *Writer) (string, error) { |
| 28 | pred, err := generator.GeneratePredicate(ctx) |
| 29 | if err != nil { |
| 30 | return "", err |
| 31 | } |
| 32 | writtenPath, err := writer.WritePredicate(pred) |
| 33 | if err != nil { |
| 34 | return "", err |
| 35 | } |
| 36 | return writtenPath, nil |
| 37 | } |
| 38 | |
| 39 | // GenerateAndWriteSnapshotPredicate generates a snapshot Predicate and writes it to a file, returning the written path. |
| 40 | func GenerateAndWriteSnapshotPredicate(ctx context.Context, generator *applicationsnapshot.SnapshotPredicateGenerator, writer *applicationsnapshot.SnapshotPredicateWriter) (string, error) { |