Documentation
¶
Index ¶
- type BinaryEngine
- func (e *BinaryEngine) ChunkerFor(fileSize int64) chunker.Chunker
- func (e *BinaryEngine) DetectByExtension(path string) bool
- func (e *BinaryEngine) DetectByHeuristic(path string, header []byte) bool
- func (e *BinaryEngine) DetectByMagic(header []byte) bool
- func (e *BinaryEngine) Diff(ctx context.Context, oldPath string, oldReader io.Reader, newPath string, ...) (string, error)
- func (e *BinaryEngine) Metadata() *core.FileMetadata
- func (e *BinaryEngine) Name() string
- func (e *BinaryEngine) Preview(header []byte, size int64, reader io.Reader, maxLines int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryEngine ¶
type BinaryEngine struct{}
BinaryEngine is the fallback engine for binary files.
func (*BinaryEngine) ChunkerFor ¶
func (e *BinaryEngine) ChunkerFor(fileSize int64) chunker.Chunker
ChunkerFor delegates to the shared binary chunker strategy (FastCDC with size-tiered parameters). Explicitly declared here — rather than via an embedded chunker.DefaultSelector on the engine struct — so that the binary package mirrors the file layout of the text/image/video engines (engine.go + chunker.go + differ.go + preview.go).
func (*BinaryEngine) DetectByExtension ¶
func (e *BinaryEngine) DetectByExtension(path string) bool
DetectByExtension returns false; binary matches no specific extension.
func (*BinaryEngine) DetectByHeuristic ¶
func (e *BinaryEngine) DetectByHeuristic(path string, header []byte) bool
DetectByHeuristic returns true; binary is the final fallback engine and matches any file that no other engine claimed.
func (*BinaryEngine) DetectByMagic ¶
func (e *BinaryEngine) DetectByMagic(header []byte) bool
DetectByMagic returns false; binary has no magic signature.
func (*BinaryEngine) Diff ¶
func (e *BinaryEngine) Diff(ctx context.Context, oldPath string, oldReader io.Reader, newPath string, newReader io.Reader) (string, error)
Diff compares two binary files by content streaming from oldReader/newReader rather than buffering either file in memory. It returns a placeholder "binary files differ" message when the bytes are not equal, and an empty string when they are identical. Binary files have no line-based diff.
func (*BinaryEngine) Metadata ¶
func (e *BinaryEngine) Metadata() *core.FileMetadata
Metadata returns the file metadata for binary files.