pbuf

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 3 Imported by: 0

README

Parallel Buffer

Like bytes.Buffer, but safe for concurrent use.

Documentation

Overview

Package pbuf - Parallel-safe bytes.Buffer replacement

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

Buffer is a wrapper around bytes.Buffer with methods safe for parallel use. A zero buffer is ready for use, but has a lock inside and should be passed around as a pointer.

func (*Buffer) Available

func (b *Buffer) Available() int

func (*Buffer) AvailableBuffer

func (b *Buffer) AvailableBuffer() []byte

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Cap

func (b *Buffer) Cap() int

func (*Buffer) Grow

func (b *Buffer) Grow(n int)

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Next

func (b *Buffer) Next(n int) []byte

func (*Buffer) Read

func (b *Buffer) Read(p []byte) (n int, err error)

func (*Buffer) ReadByte

func (b *Buffer) ReadByte() (byte, error)

func (*Buffer) ReadBytes

func (b *Buffer) ReadBytes(delim byte) (line []byte, err error)

func (*Buffer) ReadFrom

func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error)

func (*Buffer) ReadRune

func (b *Buffer) ReadRune() (r rune, size int, err error)

func (*Buffer) ReadString

func (b *Buffer) ReadString(delim byte) (line string, err error)

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) Truncate

func (b *Buffer) Truncate(n int)

func (*Buffer) UnreadByte

func (b *Buffer) UnreadByte() error

func (*Buffer) UnreadRune

func (b *Buffer) UnreadRune() error

func (*Buffer) Write

func (b *Buffer) Write(p []byte) (n int, err error)

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(c byte) error

func (*Buffer) WriteRune

func (b *Buffer) WriteRune(r rune) (n int, err error)

func (*Buffer) WriteString

func (b *Buffer) WriteString(s string) (n int, err error)

func (*Buffer) WriteTo

func (b *Buffer) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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