Documentation ¶
Index ¶
- Variables
- type Buffer
- func (b Buffer) Bytes() ([]byte, error)
- func (b *Buffer) Close() error
- func (b *Buffer) EnsureCapacity(l int) bool
- func (b *Buffer) Error() error
- func (b *Buffer) Len() int
- func (b *Buffer) Max() int
- func (b *Buffer) MustString() string
- func (b Buffer) OKBytes() []byte
- func (b *Buffer) Pad(padSize int) error
- func (b *Buffer) Read(p []byte) (int, error)
- func (b *Buffer) Release()
- func (b *Buffer) Reset()
- func (b *Buffer) Seek(offset int64, whence int) (int64, error)
- func (b Buffer) SqliteBytes() ([]byte, error)
- func (b *Buffer) String() (string, error)
- func (b Buffer) TakeBytes(l int) ([]byte, error)
- func (b *Buffer) Truncate(n int)
- func (b *Buffer) UnsafeString() (string, error)
- func (b *Buffer) Write(data []byte) (int, error)
- func (b *Buffer) WriteByte(byte byte)
- func (b *Buffer) WriteByteUnsafe(byte byte)
- func (b *Buffer) WritePad(data []byte, padSize int) (int, error)
- func (b *Buffer) WriteString(data string)
- type Config
- type Pool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxSize = errors.New("code: 3005 - buffer maximum size") Empty = new(Buffer) )
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func Containing ¶ added in v0.0.6
create a buffer that contains the specified data (mostly useful for tests)
func (*Buffer) EnsureCapacity ¶ added in v0.0.9
func (*Buffer) MustString ¶
func (Buffer) SqliteBytes ¶
optimization for passing the result to the ExecTerminated method of sqlite.Conn.
func (Buffer) TakeBytes ¶ added in v0.0.6
An advanced function. Some code might want to manipulate a []byte directly while leveraging the pre-allocated nature of a pooled buffer. Importantly, the returned bytes are not cleared
func (*Buffer) UnsafeString ¶ added in v0.0.6
func (*Buffer) WriteByteUnsafe ¶
Our caller knows that there's enough space in data (probably because it used WritePad)
func (*Buffer) WritePad ¶
Write and ensure enough capacity for len(data) + padSize Meant to be used with WriteByteUnsafe.
func (*Buffer) WriteString ¶
type Pool ¶
type Pool struct { *concurrent.Pool[*Buffer] // contains filtered or unexported fields }
func NewPoolFromConfig ¶
func (*Pool) CheckoutMax ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.