inspect

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTextDiffBytes          int64 = 1 << 20
	MaxArchiveFiles           int   = 500
	MaxArchivePathDepth       int   = 2
	MaxArchiveUncompressedSum int64 = 100 << 20
	TextSniffBytes            int   = 8192
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveEntry

type ArchiveEntry struct {
	Path        string
	SizeBytes   int64
	IsDirectory bool
}

type ComparePair

type ComparePair struct {
	Left  StateKind
	Right StateKind
}

func SelectDefaultPair

func SelectDefaultPair(
	planMode string,
	comparison review.StateComparison,
) ComparePair

type ImageMetadata

type ImageMetadata struct {
	Format    string
	Width     int
	Height    int
	SHA256    string
	SizeBytes int64
}

type InspectionKind

type InspectionKind string
const (
	InspectionTextDiff       InspectionKind = "text_diff"
	InspectionPEMetadata     InspectionKind = "pe_metadata"
	InspectionImageMetadata  InspectionKind = "image_metadata"
	InspectionArchiveListing InspectionKind = "archive_listing"
	InspectionBinaryFallback InspectionKind = "binary_fallback"
)

type InspectionResult

type InspectionResult struct {
	RelativePath        string
	Kind                InspectionKind
	LeftState           StateKind
	RightState          StateKind
	Left                SideMetadata
	Right               SideMetadata
	TextLines           []TextDiffLine
	PEMetadataLeft      *PEMetadata
	PEMetadataRight     *PEMetadata
	ImageMetadataLeft   *ImageMetadata
	ImageMetadataRight  *ImageMetadata
	ArchiveEntriesLeft  []ArchiveEntry
	ArchiveEntriesRight []ArchiveEntry
	LimitReached        bool
	LimitReason         string
	FallbackReason      string
}

func Inspect

func Inspect(
	entry review.CachedPreview,
	gameInstallPath string,
	relativePath string,
) (result InspectionResult, err error)

type PEMetadata

type PEMetadata struct {
	Machine         string
	SectionCount    int
	Characteristics string
	IsDLL           bool
	IsEXE           bool
	SHA256          string
	SizeBytes       int64
}

type SideMetadata

type SideMetadata struct {
	StateKind         StateKind
	Label             string
	Available         bool
	UnavailableReason string
	SHA256            string
	SizeBytes         int64
}

type StateKind

type StateKind string
const (
	StateBaseline StateKind = "baseline"
	StateApplied  StateKind = "applied"
	StateCurrent  StateKind = "current"
	StateDesired  StateKind = "desired"
)

type TextDiffLine

type TextDiffLine struct {
	Kind   string
	Line   string
	LineNo int
}

Jump to

Keyboard shortcuts

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