Documentation
¶
Overview ¶
gatedio provides wrappers around the io.ReadWriter, io.Writer, and io.Reader interfaces to support concurrent usage and access across multiple goroutines.
Index ¶
- type Buffer
- type ByteBuffer
- func (b *ByteBuffer) Bytes() []byte
- func (b *ByteBuffer) Cap() int
- func (b *ByteBuffer) Grow(n int)
- func (b *ByteBuffer) Len() int
- func (b *ByteBuffer) Next(n int) []byte
- func (b *ByteBuffer) Read(p []byte) (int, error)
- func (b *ByteBuffer) ReadByte() (byte, error)
- func (b *ByteBuffer) ReadBytes(delim byte) ([]byte, error)
- func (b *ByteBuffer) ReadFrom(r io.Reader) (int64, error)
- func (b *ByteBuffer) ReadRune() (rune, int, error)
- func (b *ByteBuffer) ReadString(delim byte) (string, error)
- func (b *ByteBuffer) Reset()
- func (b *ByteBuffer) String() string
- func (b *ByteBuffer) Truncate(n int)
- func (b *ByteBuffer) UnreadByte() error
- func (b *ByteBuffer) UnreadRune() error
- func (b *ByteBuffer) Write(p []byte) (int, error)
- func (b *ByteBuffer) WriteByte(c byte) error
- func (b *ByteBuffer) WriteRune(r rune) (int, error)
- func (b *ByteBuffer) WriteString(s string) (int, error)
- func (b *ByteBuffer) WriteTo(w io.Writer) (int64, error)
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
Buffer implements io.ReadWriter which can be passed to multiple concurrent goroutines. Buffer buffers all reads and writes using an internal mutex so that reading and writing to the buffer is safe.
func NewBuffer ¶
func NewBuffer(rw io.ReadWriter) *Buffer
NewBuffer creates a new buffered io.ReadWriter.
type ByteBuffer ¶
ByteBuffer is a wrapper around a bytes.Buffer.
func NewByteBuffer ¶
func NewByteBuffer() *ByteBuffer
NewByteBuffer returns a wrapper around a bytes.Buffer that is safe to use across concurrent goroutines.
func (*ByteBuffer) Bytes ¶
func (b *ByteBuffer) Bytes() []byte
Bytes wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Cap ¶
func (b *ByteBuffer) Cap() int
Cap wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Grow ¶
func (b *ByteBuffer) Grow(n int)
Grow wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Len ¶
func (b *ByteBuffer) Len() int
Len wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Next ¶
func (b *ByteBuffer) Next(n int) []byte
Next wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Read ¶
func (b *ByteBuffer) Read(p []byte) (int, error)
Read wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) ReadByte ¶
func (b *ByteBuffer) ReadByte() (byte, error)
ReadByte wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) ReadBytes ¶
func (b *ByteBuffer) ReadBytes(delim byte) ([]byte, error)
ReadBytes wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) ReadFrom ¶
func (b *ByteBuffer) ReadFrom(r io.Reader) (int64, error)
ReadFrom wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) ReadRune ¶
func (b *ByteBuffer) ReadRune() (rune, int, error)
ReadRune wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) ReadString ¶
func (b *ByteBuffer) ReadString(delim byte) (string, error)
ReadString wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Reset ¶
func (b *ByteBuffer) Reset()
Reset wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) String ¶
func (b *ByteBuffer) String() string
String wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Truncate ¶
func (b *ByteBuffer) Truncate(n int)
Truncate wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) UnreadByte ¶
func (b *ByteBuffer) UnreadByte() error
UnreadByte wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) UnreadRune ¶
func (b *ByteBuffer) UnreadRune() error
UnreadRune wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) Write ¶
func (b *ByteBuffer) Write(p []byte) (int, error)
Write wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) WriteByte ¶
func (b *ByteBuffer) WriteByte(c byte) error
WriteByte wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) WriteRune ¶
func (b *ByteBuffer) WriteRune(r rune) (int, error)
WriteRune wraps a mutex around the underlying bytes.Buffer function call.
func (*ByteBuffer) WriteString ¶
func (b *ByteBuffer) WriteString(s string) (int, error)
WriteString wraps a mutex around the underlying bytes.Buffer function call.
type Reader ¶
Reader implements io.Reader which can be passed to multiple concurrent goroutines. Reader buffers all reads using an internal mutex so that reading from the buffer is safe.