Files
CephfsMig/internal/migration/native_factory_ceph.go
T
Sebastian UnterschützandClaude Opus 5.5 7705ed3eaf chore: import CephMig prototype
Initial import of the existing CephFS subvolume migration prototype,
including the native libcephfs transport, rsync backend, local Ceph
lab environment and integration tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 18:05:53 +01:00

28 lines
683 B
Go

//go:build ceph && cgo
package migration
import (
"context"
"io"
"CephMig/internal/cephfsnative"
)
func openNativeEngine(ctx context.Context, c Config, x Executor, log io.Writer) (Engine, io.Closer, error) {
if err := ctx.Err(); err != nil {
return Engine{}, nil, err
}
source, err := cephfsnative.Open(options(c.Source))
if err != nil {
return Engine{}, nil, err
}
target, err := cephfsnative.Open(options(c.Target))
if err != nil {
source.Close()
return Engine{}, nil, err
}
backend := &nativeTransport{source: source, target: target, config: c, log: log}
return Engine{Exec: x, Log: log, Transport: backend, Access: nativeAccess{backend}}, backend, nil
}