Documentation
¶
Overview ¶
Package pool provides a sync.Pool-based byte buffer pool for minimizing allocations during query building. Buffers are pre-allocated with a 256-byte capacity and reused across query construction cycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
B []byte
}
Buffer is a pooled byte buffer for building query strings.
func GetBuffer ¶
func GetBuffer() *Buffer
GetBuffer returns a Buffer from the pool. The returned buffer is empty but may have pre-allocated capacity from a previous use.
func (*Buffer) Reset ¶
func (b *Buffer) Reset()
Reset clears the buffer contents while retaining the underlying capacity.
func (*Buffer) WriteString ¶
WriteString appends a string to the buffer.
Click to show internal directories.
Click to hide internal directories.