Documentation
¶
Index ¶
- func BackupAndReplace(src, dest string) error
- func CopyFile(src, dest string) error
- func DecompressChunkSlice(chunk []byte, expectedSize uint32) ([]byte, error)
- func DecompressVSZaData(data []byte) ([]byte, error)
- func DecompressVSZaFile(filePath string) (bool, error)
- func DecompressVSZaInDir(dirPath string) (int, error)
- func DownloadAndExtract(ctx context.Context, url, destDir, format string) error
- func ExpandPath(path string) string
- func ExtractSuggestedFixes(err error) []string
- func FileExists(path string) bool
- func GetHash(filePath string) (string, error)
- func GetSHA1Hash(filePath string) (string, error)
- func IsEncryptedBase64Path(p string) bool
- func IsSteamChunkCompressed(data []byte) bool
- func IsVSZaCompressed(data []byte) bool
- func RunCmd(name string, args ...string) ([]byte, error)
- func SanitizeFilename(name string) string
- func SanitizeInstallDir(title string) string
- func WithFixes(err error, fixes ...string) error
- type FixableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupAndReplace ¶
BackupAndReplace backs up a file and replaces it.
func DecompressChunkSlice ¶ added in v1.0.112
DecompressChunkSlice decompresses a single Steam Pipe chunk slice (up to 1MB) matching any Steam Pipe stream format.
func DecompressVSZaData ¶ added in v1.0.112
DecompressVSZaData decompresses a stream of 1MB (1,048,576 byte) Steam Pipe chunk slices using any supported stream format. Files downloaded directly as raw Steam depot chunks are stored as concatenated 1MB container frames.
func DecompressVSZaFile ¶ added in v1.0.112
DecompressVSZaFile decompresses a compressed Steam depot file on disk in place. Returns true if the file was compressed and decompressed successfully.
func DecompressVSZaInDir ¶ added in v1.0.112
DecompressVSZaInDir walks dirPath recursively and decompresses any VSZa-compressed files in place. Returns the total number of files decompressed.
func DownloadAndExtract ¶
DownloadAndExtract downloads a file and extracts it.
func ExpandPath ¶ added in v1.0.108
ExpandPath resolves tilde (~) and relative paths against home directory.
func ExtractSuggestedFixes ¶ added in v1.0.107
ExtractSuggestedFixes returns suggested fixes from a FixableError if present.
func FileExists ¶ added in v0.4.0
FileExists checks if a file exists on disk.
func GetSHA1Hash ¶ added in v1.0.107
GetSHA1Hash returns the SHA1 hash of a file.
func IsEncryptedBase64Path ¶ added in v1.0.109
IsEncryptedBase64Path checks if a filename or path contains raw un-decrypted AES base64 output.
func IsSteamChunkCompressed ¶ added in v1.0.112
IsSteamChunkCompressed checks if data starts with any known Steam Pipe chunk container header. Supported stream formats: 1. "VSZa": Valve Zstandard chunk container (magic 0x56 0x53 0x5A 0x61) 2. "VZ" / "VZa": Valve LZMA chunk container (magic 0x56 0x5A) 3. "PK\x03\x04": Zip archive chunk (magic 0x50 0x4B 0x03 0x04) 4. 0x28B52FFD: Raw Zstandard frame
func IsVSZaCompressed ¶ added in v1.0.112
IsVSZaCompressed checks if data starts with Valve's VSZa zstd container header. Valve's VSZa chunk container format uses: - 4 bytes magic: "VSZa" (0x56 0x53 0x5A 0x61) - 4 bytes header metadata: 32-bit CRC32 checksum / chunk metadata - Payload: Zstandard (zstd) compressed frame starting at offset 8
func SanitizeFilename ¶ added in v1.0.107
SanitizeFilename replaces illegal filesystem characters with dashes to return a clean folder name.
func SanitizeInstallDir ¶ added in v1.0.108
SanitizeInstallDir converts a game title into a clean, 1:1 Steam-style installdir folder name. It removes trademark/registered symbols (™, ®, ©), removes illegal OS path characters, and normalizes whitespace while preserving standard folder readability.
Types ¶
type FixableError ¶ added in v1.0.107
FixableError is an error interface that carries suggested diagnostic fix actions.