refactor(pipeline): ввести Runner интерфейс

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-08-09 00:32:07 +03:00
parent 328f517543
commit 9c6fc8cffa
3 changed files with 20 additions and 17 deletions
+4 -13
View File
@@ -35,17 +35,7 @@ var (
outputWriter io.Writer = os.Stderr
)
type pipelineRunner interface {
Run(
ctx context.Context,
pgDumpOpts pgdump.Options,
recipients []crypto.RecipientPub,
sink domain.Sink,
rand io.Reader,
) error
}
func defaultNewRunner(options ...pipeline.Option) pipelineRunner {
func defaultNewRunner(options ...pipeline.Option) pipeline.Runner {
return pipeline.NewRunner(options...)
}
@@ -91,7 +81,8 @@ var backupCmd = &cobra.Command{
return fmt.Errorf("load classical public key: %w", err)
}
recipients := []crypto.RecipientPub{pqPub, classicalPub}
recipients := make([]crypto.RecipientPub, 0, 2)
recipients = append(recipients, pqPub, classicalPub)
pgDumpOpts := pgdump.Options{
Host: cfg.PG.Host,
@@ -110,7 +101,7 @@ var backupCmd = &cobra.Command{
slog.String("output_path", finalPath),
)
sink := newLocalSink(cfg.Backup.Dir)
var sink domain.Sink = newLocalSink(cfg.Backup.Dir)
registry := crypto.NewRegistry()
_ = registry.Register(0x0006, func() crypto.KEM { return mlkem768.New() })