Documentation
¶
Overview ¶
Package protocol provides shared constants and data structures for tar-diff operations.
Index ¶
Constants ¶
View Source
const ( DeltaOpData = iota // Raw data operation DeltaOpOpen = iota // Open file operation DeltaOpCopy = iota // Copy from source operation DeltaOpAddData = iota // Add new data operation DeltaOpSeek = iota // Seek operation )
Delta operation constants define the types of operations in a delta file.
Variables ¶
View Source
var DeltaHeader = [...]byte{'t', 'a', 'r', 'd', 'f', '1', '\n', 0}
DeltaHeader is the magic header bytes for tar-diff files.
View Source
var VERSION = "v0.2.0"
VERSION contains the current version string for the tar-diff tool.
Functions ¶
func CleanPath ¶
CleanPath cleans up the path lexically and prevents path traversal attacks. Any ".." that extends outside the first elements (or the root itself) is invalid and returns "". Uses filepath.Clean for proper cross-platform path handling (Windows backslashes, drive letters). This is a security-critical function used by both tar-diff and tar-patch packages.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.