Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBinaryContent = fmt.Errorf("file contains binary content")
ErrBinaryContent indicates that a file classified as text actually contains binary data and should not be diffed as text.
Functions ¶
This section is empty.
Types ¶
type BinaryDiff ¶
type BinaryDiff struct {
Symbols []SymbolChange `json:"symbols"`
Sections []SectionChange `json:"sections"`
}
BinaryDiff contains symbol and section differences between two Mach-O binaries.
type DetailResult ¶
type DetailResult struct {
Kind FileKind `json:"kind"`
Plist *PlistDiff `json:"plist,omitempty"`
Binary *BinaryDiff `json:"binary,omitempty"`
Text *TextDiff `json:"text,omitempty"`
Dir *DirSummary `json:"dir,omitempty"`
}
DetailResult holds an on-demand detail diff for a single node.
type DiffStatus ¶
type DiffStatus int
DiffStatus represents the diff status of a node.
const ( Unchanged DiffStatus = iota Added Removed Modified )
func (DiffStatus) MarshalJSON ¶
func (s DiffStatus) MarshalJSON() ([]byte, error)
func (DiffStatus) String ¶
func (s DiffStatus) String() string
type DirSummary ¶
type DirSummary struct {
TotalFiles int `json:"total_files"`
Added int `json:"added"`
Removed int `json:"removed"`
Modified int `json:"modified"`
Unchanged int `json:"unchanged"`
SizeDelta int64 `json:"size_delta"`
}
DirSummary holds aggregate statistics for a directory node.
type FileKind ¶
type FileKind int
FileKind represents the detected type of a file.
func (FileKind) MarshalJSON ¶
type Line ¶
type Line struct {
Kind string `json:"kind"` // "context", "added", "removed"
Content string `json:"content"`
}
Line represents a single line in a diff hunk.
type Node ¶
type Node struct {
Name string `json:"name"`
Path string `json:"path"`
Status DiffStatus `json:"status"`
Kind FileKind `json:"kind"`
IsDir bool `json:"is_dir"`
SizeA int64 `json:"size_a"`
SizeB int64 `json:"size_b"`
Children []*Node `json:"children,omitempty"`
}
Node represents a single entry in the diff tree.
type PlistChange ¶
type PlistChange struct {
KeyPath string `json:"key_path"`
Status DiffStatus `json:"status"`
ValueA string `json:"value_a,omitempty"`
ValueB string `json:"value_b,omitempty"`
}
PlistChange represents a single key-path change in a plist diff.
type PlistDiff ¶
type PlistDiff struct {
Changes []PlistChange `json:"changes"`
}
PlistDiff contains key-level changes between two plists.
type Result ¶
type Result struct {
PathA string `json:"path_a"`
PathB string `json:"path_b"`
Mode Mode `json:"mode"`
Root *Node `json:"root"`
Summary Summary `json:"summary"`
}
Result is the top-level output of a comparison.
type SectionChange ¶
type SectionChange struct {
Segment string `json:"segment"`
Section string `json:"section"`
SizeA int64 `json:"size_a"`
SizeB int64 `json:"size_b"`
}
SectionChange represents a size change in a Mach-O section.
type Summary ¶
type Summary struct {
Added int `json:"added"`
Removed int `json:"removed"`
Modified int `json:"modified"`
Unchanged int `json:"unchanged"`
SizeDelta int64 `json:"size_delta"`
}
Summary aggregates diff statistics.
func ComputeSummary ¶
ComputeSummary walks the tree and computes aggregate statistics.
type SymbolChange ¶
type SymbolChange struct {
Name string `json:"name"`
Status DiffStatus `json:"status"`
}
SymbolChange represents a symbol that was added or removed.