bufutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bufutil 提供共享的缓冲区工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CappedBuffer

type CappedBuffer struct {
	// contains filtered or unexported fields
}

CappedBuffer 有容量上限的输出缓冲区 写入超过上限后静默丢弃多余数据,不报错

func NewCappedBuffer

func NewCappedBuffer(maxBytes int) *CappedBuffer

NewCappedBuffer 创建指定容量上限的缓冲区

func (*CappedBuffer) String

func (b *CappedBuffer) String() string

func (*CappedBuffer) Truncated

func (b *CappedBuffer) Truncated() bool

Truncated 返回是否发生过截断

func (*CappedBuffer) Write

func (b *CappedBuffer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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