Module reader

Module reader 

Source
Expand description

Smart file reader with automatic decompression support.

Provides transparent decompression for .gz and .zst files, allowing analysis of compressed audit logs without manual extraction.

§Supported Formats

  • Plain text files
  • Gzip compressed files (.gz)
  • Zstandard compressed files (.zst)

§Examples

use vault_audit_tools::utils::reader::open_file;
use std::io::{BufRead, BufReader};

// Automatically handles .gz, .zst, or plain text
let reader = open_file("audit.log.gz").unwrap();
let buf_reader = BufReader::new(reader);

for line in buf_reader.lines() {
    let line = line.unwrap();
    // Process line...
}

Functions§

open_file
Opens a file with automatic decompression based on extension.