syncio

package
v0.0.0-...-5720ada Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package syncio is a collection of thread-safe wrappers of top of standard io libraries.

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 on top of bytes.Buffer, but with a RWMutex to protect concurrent calls.

func NewBuffer

func NewBuffer(buf []byte) *Buffer

func NewBufferString

func NewBufferString(s string) *Buffer

func (*Buffer) Bytes

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

func (*Buffer) Cap

func (rw *Buffer) Cap() int

func (*Buffer) Grow

func (rw *Buffer) Grow(n int)

func (*Buffer) Len

func (rw *Buffer) Len() int

func (*Buffer) Next

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

func (*Buffer) Read

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

func (*Buffer) ReadByte

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

func (*Buffer) ReadBytes

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

func (*Buffer) ReadFrom

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

func (*Buffer) ReadRune

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

func (*Buffer) ReadString

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

func (*Buffer) Reset

func (rw *Buffer) Reset()

func (*Buffer) String

func (rw *Buffer) String() string

func (*Buffer) Truncate

func (rw *Buffer) Truncate(n int)

func (*Buffer) UnreadByte

func (rw *Buffer) UnreadByte() error

func (*Buffer) UnreadRune

func (rw *Buffer) UnreadRune() error

func (*Buffer) Write

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

func (*Buffer) WriteByte

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

func (*Buffer) WriteRune

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

func (*Buffer) WriteString

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

func (*Buffer) WriteTo

func (rw *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