fetch_ml/internal/worker/hash_selector.go
Jeremie Fraeys a93b6715fd
feat: add native library bridge and queue integration
- 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
2026-02-16 20:38:30 -05:00

16 lines
617 B
Go

package worker
// UseNativeLibs controls whether to use C++ implementations.
// Set FETCHML_NATIVE_LIBS=1 to enable native libraries.
// This is defined here so it's available regardless of build tags.
var UseNativeLibs = false
// dirOverallSHA256Hex selects implementation based on toggle.
// This file has no CGo imports so it compiles even when CGO is disabled.
// The actual implementations are in native_bridge.go (native) and data_integrity.go (Go).
func dirOverallSHA256Hex(root string) (string, error) {
if !UseNativeLibs {
return dirOverallSHA256HexGo(root)
}
return dirOverallSHA256HexNative(root)
}