buffer

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

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

func (*SizeLimitedBuffer) Write

func (c *SizeLimitedBuffer) Write(p []byte) (int, error)

type WriteTooLargeError

type WriteTooLargeError int

func (WriteTooLargeError) Error

func (l WriteTooLargeError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL