buffer

package
v3.80.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package buffer provides a custom buffer type that includes metrics for tracking buffer usage. It also provides a pool for managing buffer reusability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadCloser

func ReadCloser(data []byte, onClose func()) *readCloser

ReadCloser creates a new instance of readCloser.

Types

type Buffer

type Buffer struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

Buffer is a wrapper around bytes.Buffer that includes a timestamp for tracking Buffer checkout duration.

func NewBuffer

func NewBuffer() *Buffer

NewBuffer creates a new instance of Buffer.

func (*Buffer) Grow

func (b *Buffer) Grow(size int)

func (*Buffer) RecordMetric

func (b *Buffer) RecordMetric()

func (*Buffer) ResetMetric

func (b *Buffer) ResetMetric()

func (*Buffer) Write

func (b *Buffer) Write(data []byte) (int, error)

Write date to the buffer.

Jump to

Keyboard shortcuts

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