Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SizeLimitedBuffer ¶
type SizeLimitedBuffer struct {
// contains filtered or unexported fields
}
SizeLimitedBuffer contains a buffer that can be written to up to a given limit size. When attempting to write content that would push it over the limit, a `WriteTooLargeError` will be returned. NewSizeLimitedBuffer should be used to create a SizeLimitedBuffer.
func NewSizeLimitedBuffer ¶
func NewSizeLimitedBuffer(limit int) SizeLimitedBuffer
NewSizeLimitedBuffer initialises a new SizeLimitedBuffer.
func (*SizeLimitedBuffer) Bytes ¶
func (c *SizeLimitedBuffer) Bytes() []byte
type WriteTooLargeError ¶
type WriteTooLargeError int
func (WriteTooLargeError) Error ¶
func (l WriteTooLargeError) Error() string
Click to show internal directories.
Click to hide internal directories.