-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuffer_pool.go
More file actions
41 lines (32 loc) · 964 Bytes
/
Copy pathbuffer_pool.go
File metadata and controls
41 lines (32 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"bytes"
"compress/gzip"
"io"
"github.com/lukaszraczylo/graphql-monitoring-proxy/pkg/pools"
)
// Legacy compatibility layer - delegates to unified pool implementation
// GetHTTPBuffer gets a buffer from the global pool
func GetHTTPBuffer() *bytes.Buffer {
return pools.GetBuffer()
}
// PutHTTPBuffer returns a buffer to the global pool
func PutHTTPBuffer(buf *bytes.Buffer) {
pools.PutBuffer(buf)
}
// GetGzipWriter gets a gzip writer from the global pool
func GetGzipWriter(w io.Writer) *gzip.Writer {
return pools.GetGzipWriter(w)
}
// PutGzipWriter returns a gzip writer to the global pool
func PutGzipWriter(gz *gzip.Writer) {
pools.PutGzipWriter(gz)
}
// GetGzipReader gets a gzip reader from the global pool
func GetGzipReader(r io.Reader) (*gzip.Reader, error) {
return pools.GetGzipReader(r)
}
// PutGzipReader returns a gzip reader to the global pool
func PutGzipReader(gr *gzip.Reader) {
pools.PutGzipReader(gr)
}