Documentation ¶
Overview ¶
Package sdcompress 一些常见的压缩算法
Index ¶
- Constants
- Variables
- func Gzip(data []byte, level GzipLevel) ([]byte, error)
- func Lz4(data []byte, level Lz4Level) ([]byte, error)
- func Ungzip(data []byte) ([]byte, error)
- func Unlz4(data []byte) ([]byte, error)
- func Unzip(data []byte) ([]byte, error)
- func Zip(data []byte, level ZlibLevel) ([]byte, error)
- type GzipLevel
- type Lz4Level
- type ZlibLevel
Constants ¶
View Source
const ( GzipNoCompression = GzipLevel(gzip.NoCompression) GzipBestSpeed = GzipLevel(gzip.BestSpeed) GzipBestCompression = GzipLevel(gzip.BestCompression) GzipDefaultCompression = GzipLevel(gzip.DefaultCompression) GzipHuffmanOnly = GzipLevel(gzip.HuffmanOnly) )
View Source
const ( Lz4Fast = Lz4Level(lz4.Fast) Lz4Level1 = Lz4Level(lz4.Level1) Lz4Level2 = Lz4Level(lz4.Level2) Lz4Level3 = Lz4Level(lz4.Level3) Lz4Level4 = Lz4Level(lz4.Level4) Lz4Level5 = Lz4Level(lz4.Level5) Lz4Level6 = Lz4Level(lz4.Level6) Lz4Level7 = Lz4Level(lz4.Level7) Lz4Level8 = Lz4Level(lz4.Level8) Lz4Level9 = Lz4Level(lz4.Level9) )
View Source
const ( ZlibNoCompression = ZlibLevel(zlib.NoCompression) ZlibBestSpeed = ZlibLevel(zlib.BestSpeed) ZlibBestCompression = ZlibLevel(zlib.BestCompression) ZlibDefaultCompression = ZlibLevel(zlib.DefaultCompression) ZlibHuffmanOnly = ZlibLevel(zlib.HuffmanOnly) )
Variables ¶
View Source
var ( GzipAllLevels = []GzipLevel{ GzipNoCompression, GzipBestSpeed, GzipBestCompression, GzipDefaultCompression, GzipHuffmanOnly, } )
View Source
var ( Lz4AllLevels = []Lz4Level{ Lz4Fast, Lz4Level1, Lz4Level2, Lz4Level3, Lz4Level4, Lz4Level5, Lz4Level6, Lz4Level7, Lz4Level8, Lz4Level9, } )
View Source
var ( ZlibAllLevels = []ZlibLevel{ ZlibNoCompression, ZlibBestSpeed, ZlibBestCompression, ZlibDefaultCompression, ZlibHuffmanOnly, } )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.