Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TruncatedBuffer ¶
type TruncatedBuffer struct {
// contains filtered or unexported fields
}
TruncatedBuffer contains a bytes buffer that has a limited capacity The buffer is truncated on Write if the length reaches the maximum capacity Only the first bytes are preserved
func NewTruncatedBuffer ¶
func NewTruncatedBuffer(cap int) *TruncatedBuffer
NewTruncatedBuffer returns a new TruncatedBuffer If the provided cap is 0, the truncated buffer has no limit for truncating
func (TruncatedBuffer) GetBuffer ¶
func (b TruncatedBuffer) GetBuffer() *bytes.Buffer
GetCap returns the buffer
func (TruncatedBuffer) GetCap ¶
func (b TruncatedBuffer) GetCap() int
GetCap returns the maximum capacity of the buffer
Click to show internal directories.
Click to hide internal directories.