gzip

package
v1.2.4 Latest Latest
Warning

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

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

Documentation

Overview

Package gzip provides utilities for creating and extracting gzip compressed files.

This package wraps the compress/gzip standard library to provide convenient functions for compressing and decompressing single files.

Features:

  • Compress single files to gzip format
  • Decompress gzip files to original format
  • Automatic directory creation
  • File permission preservation

Example usage:

err := gzip.Compress("output.gz", "input.txt")
err := gzip.Decompress("archive.gz", "extracted.txt")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(name string, path string) error

Compress compresses a single file into gzip format.

Parameters:

  • name: output gzip file path (e.g., "test.gz")
  • path: input file path to compress

Example:

err := gzip.Compress("test.gz", "test.txt")

func Decompress

func Decompress(gzipName, fileName, outputPath string) error

Decompress decompresses a gzip file.

Parameters:

  • gzipName: input gzip file path (e.g., "test.gz")
  • fileName: output file name (e.g., "test.txt")
  • outputPath: output directory path

Example:

err := gzip.Decompress("test.gz", "test.txt", "./output")

Types

This section is empty.

Jump to

Keyboard shortcuts

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