 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶ added in v0.45.0
type Compressor struct {
	Config
	// contains filtered or unexported fields
}
    func (*Compressor) Close ¶ added in v0.45.0
func (c *Compressor) Close() error
Close closes encoder and decoder, returns any error occurred.
func (*Compressor) Compress ¶ added in v0.45.0
func (c *Compressor) Compress(data []byte) []byte
Compress compresses data if compression is enabled and returns data untouched otherwise.
func (*Compressor) Decompress ¶ added in v0.45.0
func (c *Compressor) Decompress(data []byte) ([]byte, error)
Decompress decompresses data if it starts with the magic and returns data untouched otherwise.
func (*Compressor) Init ¶ added in v0.45.0
func (c *Compressor) Init() error
Init initializes compression routines.
type Config ¶
type Config struct {
	Enabled                    bool
	UncompressableContentTypes []string
	Level                      Level
	EstimateCompressibility          bool
	EstimateCompressibilityThreshold float64
}
    Config represents common compression-related configuration.
func (*Config) HasValidCompressionLevel ¶ added in v0.45.0
func (*Config) NeedsCompression ¶
NeedsCompression returns true if the object should be compressed. For an object to be compressed 2 conditions must hold: 1. Compression is enabled in settings. 2. Object MIME Content-Type is allowed for compression.
 Click to show internal directories. 
   Click to hide internal directories.