Package decompress

import "github.com/byte-mug/fastnntp-backend2/decompress"

Overview

A decompression plugin system. This is used for the TRADGROUP code, because <CONFIG>/active and <CONFIG>/newsgroups have compressed counterparts, one in the ".bz2" format and one in ".gz", which should be supported.

Also, i prefer to use github.com/klauspost/compress for more speed.

Index

func Register

func Register(ext string, deco Decoder, prio int)

-

type Decoder

type Decoder func(io.ReadCloser) (io.ReadCloser, error)

-

func Get

func Get(ext string) Decoder

Returns the matching Decoder or nil if not supported.

ext is the file extension like ".gz", ".bz2", or, if no compression is used, "".

Dependencies

Directories

PathSynopsis
gz/A bzip2 plugin for decomp.
bz2/A bzip2 plugin for decomp.