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 ¶
const GzExtension = ".nzb.gz"
GzExtension is the persistent storage extension for gzip-compressed NZB files.
const PlainExtension = ".nzb"
PlainExtension is the persistent storage extension for uncompressed NZB files.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
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.