Documentation
¶
Index ¶
- Variables
- func DeserializeSettings(s string) (CompressionAlgorithm, CompressionLevel, error)
- func NewSettings(algo, level string) (CompressionAlgorithm, CompressionLevel, error)
- func SerializeSettings(algo CompressionAlgorithm, level CompressionLevel) string
- type CompressionAlgorithm
- type CompressionLevel
- type Compressor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CompressionAlgoZstd = CompressionAlgorithm(1) CompressionLevelZstdFastest = CompressionLevel(zstd.SpeedFastest) CompressionLevelZstdDefault = CompressionLevel(zstd.SpeedDefault) // "pretty fast" compression CompressionLevelZstdBetter = CompressionLevel(zstd.SpeedBetterCompression) CompressionLevelZstdBest = CompressionLevel(zstd.SpeedBestCompression) CompressionAlgoZstdCgo = CompressionAlgorithm(2) CompressionLevelZstdCgoFastest = CompressionLevel(zstdcgo.BestSpeed) // 1 CompressionLevelZstdCgoDefault = CompressionLevel(zstdcgo.DefaultCompression) // 5 CompressionLevelZstdCgoBest = CompressionLevel(zstdcgo.BestCompression) // 20 )
Functions ¶
func DeserializeSettings ¶
func DeserializeSettings(s string) (CompressionAlgorithm, CompressionLevel, error)
DeserializeSettings deserializes the compression settings.
func NewSettings ¶
func NewSettings(algo, level string) (CompressionAlgorithm, CompressionLevel, error)
func SerializeSettings ¶
func SerializeSettings(algo CompressionAlgorithm, level CompressionLevel) string
SerializeSettings serializes the compression settings.
Types ¶
type CompressionAlgorithm ¶
type CompressionAlgorithm int
CompressionAlgorithm is the interface that wraps the compression algorithm method.
func (CompressionAlgorithm) String ¶
func (c CompressionAlgorithm) String() string
type CompressionLevel ¶
type CompressionLevel int
CompressionLevel is the interface that wraps the compression level method.
func (CompressionLevel) String ¶
func (c CompressionLevel) String() string
type Compressor ¶
type Compressor struct {
// contains filtered or unexported fields
}
func New ¶
func New(algo CompressionAlgorithm, level CompressionLevel) (*Compressor, error)
func (*Compressor) Close ¶
func (c *Compressor) Close() error
func (*Compressor) Decompress ¶
func (c *Compressor) Decompress(src []byte) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.