Documentation
¶
Index ¶
- func Compress(compOptions []Compression, out io.Writer, in io.Reader, hs *utils.HasherSizer) string
- func VerifiedCompression(c Compression, out io.Writer, read io.Reader, hs *utils.HasherSizer)
- type Compression
- type LeptonCompression
- func (n *LeptonCompression) AlgName() string
- func (n *LeptonCompression) Compress(out io.Writer, in io.Reader) error
- func (n *LeptonCompression) Decompress(in io.Reader) io.ReadCloser
- func (n *LeptonCompression) DecompressionTrollBashCommandIncludingThePipe() string
- func (n *LeptonCompression) Fallible() bool
- type NoCompression
- type ZstdCompression
- func (n *ZstdCompression) AlgName() string
- func (n *ZstdCompression) Compress(out io.Writer, in io.Reader) error
- func (n *ZstdCompression) Decompress(in io.Reader) io.ReadCloser
- func (n *ZstdCompression) DecompressionTrollBashCommandIncludingThePipe() string
- func (n *ZstdCompression) Fallible() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
func Compress(compOptions []Compression, out io.Writer, in io.Reader, hs *utils.HasherSizer) string
func VerifiedCompression ¶
func VerifiedCompression(c Compression, out io.Writer, read io.Reader, hs *utils.HasherSizer)
compress data while also verifying that the stream will decompress back to the same data but without buffering - do the whole thing streaming
Types ¶
type Compression ¶
type Compression interface {
// these two should only return once they are completely finished
// behavior: panic on IO error, panic on compression failure if thought to be infallible, return error on failable compression failure
Compress(out io.Writer, in io.Reader) error
Decompress(in io.Reader) io.ReadCloser
AlgName() string
// can this compression fail if fed unexpected input?
// a general purpose compression like zstd or xz should return false, since they work on any arbitrary input bytes
// special purpose compression such as lepton should return true, since it only works on well-formed jpgs
Fallible() bool
DecompressionTrollBashCommandIncludingThePipe() string
}
func ByAlgName ¶
func ByAlgName(algName string) Compression
func SelectCompressionForPath ¶
func SelectCompressionForPath(path string) []Compression
type LeptonCompression ¶
type LeptonCompression struct{}
func (*LeptonCompression) AlgName ¶
func (n *LeptonCompression) AlgName() string
func (*LeptonCompression) Decompress ¶
func (n *LeptonCompression) Decompress(in io.Reader) io.ReadCloser
func (*LeptonCompression) DecompressionTrollBashCommandIncludingThePipe ¶
func (n *LeptonCompression) DecompressionTrollBashCommandIncludingThePipe() string
func (*LeptonCompression) Fallible ¶
func (n *LeptonCompression) Fallible() bool
type NoCompression ¶
type NoCompression struct{}
func (*NoCompression) AlgName ¶
func (n *NoCompression) AlgName() string
func (*NoCompression) Decompress ¶
func (n *NoCompression) Decompress(in io.Reader) io.ReadCloser
func (*NoCompression) DecompressionTrollBashCommandIncludingThePipe ¶
func (n *NoCompression) DecompressionTrollBashCommandIncludingThePipe() string
func (*NoCompression) Fallible ¶
func (n *NoCompression) Fallible() bool
type ZstdCompression ¶
type ZstdCompression struct{}
func (*ZstdCompression) AlgName ¶
func (n *ZstdCompression) AlgName() string
func (*ZstdCompression) Decompress ¶
func (n *ZstdCompression) Decompress(in io.Reader) io.ReadCloser
func (*ZstdCompression) DecompressionTrollBashCommandIncludingThePipe ¶
func (n *ZstdCompression) DecompressionTrollBashCommandIncludingThePipe() string
func (*ZstdCompression) Fallible ¶
func (n *ZstdCompression) Fallible() bool
Click to show internal directories.
Click to hide internal directories.