Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GzipWriterPool = &sync.Pool{ New: func() interface{} { gw, err := gzip.NewWriterLevel(nil, defaultGzipContentEncodingLevel) if err != nil { panic(err) } return gw }, } GzipReaderPool = &sync.Pool{ New: func() interface{} { gw := GzipWriterPool.Get().(*gzip.Writer) defer GzipWriterPool.Put(gw) b := new(bytes.Buffer) gw.Reset(b) gw.Flush() gw.Close() gr, err := gzip.NewReader(bytes.NewReader(b.Bytes())) if err != nil { panic(err.Error()) } return gr }, } )
View Source
var (
BytesPool = &bytesPool{pool: make(chan []byte, 1000), baseWidth: 32 * 1024} // 32KB
)
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.