Documentation ¶
Index ¶
- func BeginLeptonProcess(in io.Reader) (*exec.Cmd, io.ReadCloser)
- func CheckCompression()
- func Compress(path string, 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 WrappedReadCloserHackToAvoidZombieProcess
- 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 BeginLeptonProcess ¶
func CheckCompression ¶
func CheckCompression()
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
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 WrappedReadCloserHackToAvoidZombieProcess ¶
type WrappedReadCloserHackToAvoidZombieProcess struct {
// contains filtered or unexported fields
}
func (*WrappedReadCloserHackToAvoidZombieProcess) Close ¶
func (w *WrappedReadCloserHackToAvoidZombieProcess) Close() error
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.