nzbfile

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package nzbfile centralizes on-disk NZB I/O, hiding gzip compression so callers always deal with plain XML regardless of how the file is stored.

Index

Constants

View Source
const GzExtension = ".nzb.gz"

GzExtension is the persistent storage extension for gzip-compressed NZB files.

View Source
const PlainExtension = ".nzb"

PlainExtension is the persistent storage extension for uncompressed NZB files.

Variables

This section is empty.

Functions

func Compress

func Compress(srcPath, dstPath string) error

Compress reads the NZB at srcPath and writes a gzip-compressed copy to dstPath.

func IsGzipped

func IsGzipped(path string) bool

IsGzipped reports whether path points to a gzip-compressed NZB by suffix.

func Open

func Open(path string) (io.ReadCloser, error)

Open opens an NZB file for reading, transparently decompressing .nzb.gz files so callers always receive plain XML. The caller must Close the result.

func PlainFilename

func PlainFilename(path string) string

PlainFilename returns the base filename with any .gz suffix stripped, so downstream consumers (download clients, external SABnzbd) see a plain .nzb. The case of the original name is preserved.

func ResolveOnDisk

func ResolveOnDisk(path string) (string, error)

ResolveOnDisk returns an existing path for an NZB, tolerating drift between the stored extension and what's actually on disk (e.g. legacy rows pointing at .nzb while the file was later gzipped, or vice versa). Returns the input path unchanged if it exists, the .gz-toggled variant if that exists, or (path, os.ErrNotExist) otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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