- Add native_queue.go with CGO bindings for queue operations - Add native_queue_stub.go for non-CGO builds - Add hash_selector to choose between Go and native implementations - Add native_bridge_libs.go for CGO builds with native_libs tag - Add native_bridge_nocgo.go stub for non-CGO builds - Update queue errors and task handling for native integration - Update worker config and runloop for native library support
40 lines
1 KiB
Go
40 lines
1 KiB
Go
//go:build !cgo
|
|
// +build !cgo
|
|
|
|
package worker
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/jfraeys/fetch_ml/internal/manifest"
|
|
)
|
|
|
|
// dirOverallSHA256HexNative is not available without CGO.
|
|
func dirOverallSHA256HexNative(root string) (string, error) {
|
|
return "", errors.New("native hash requires CGO")
|
|
}
|
|
|
|
// HashFilesBatchNative is not available without CGO.
|
|
func HashFilesBatchNative(paths []string) ([]string, error) {
|
|
return nil, errors.New("native batch hash requires CGO")
|
|
}
|
|
|
|
// GetSIMDImplName returns "disabled" without CGO.
|
|
func GetSIMDImplName() string {
|
|
return "disabled (no CGO)"
|
|
}
|
|
|
|
// HasSIMDSHA256 returns false without CGO.
|
|
func HasSIMDSHA256() bool {
|
|
return false
|
|
}
|
|
|
|
// ScanArtifactsNative is disabled without CGO.
|
|
func ScanArtifactsNative(runDir string) (*manifest.Artifacts, error) {
|
|
return nil, errors.New("native artifact scanner requires CGO")
|
|
}
|
|
|
|
// ExtractTarGzNative is disabled without CGO.
|
|
func ExtractTarGzNative(archivePath, dstDir string) error {
|
|
return errors.New("native tar.gz extractor requires CGO")
|
|
}
|