protocol

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

func CleanPath(pathName string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL