bio

package
v0.0.0-...-3d1188e Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCount

func FormatCount(count uint64) string

func NewNoCloseBody

func NewNoCloseBody(b []byte) io.ReadCloser

func NewRWC

func NewRWC(r io.Reader, w io.Writer, c io.Closer) io.ReadWriteCloser

Types

type Broadcast

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

func NewBroadcast

func NewBroadcast() *Broadcast

func NewBroadcastWithReader

func NewBroadcastWithReader(r io.Reader, size int) *Broadcast

func (*Broadcast) DelAndCloseListener

func (bc *Broadcast) DelAndCloseListener(id int64)

func (*Broadcast) DelListener

func (bc *Broadcast) DelListener(id int64)

func (*Broadcast) SetListener

func (bc *Broadcast) SetListener(wc io.WriteCloser) int64

func (*Broadcast) Write

func (bc *Broadcast) Write(b []byte) (n int, err error)

type BufferReader

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

func NewBufferReader

func NewBufferReader(rp readerPacket) *BufferReader

func NewBufferReaderWithOpt

func NewBufferReaderWithOpt(rp readerPacket, min, max int) *BufferReader

func (*BufferReader) Read

func (br *BufferReader) Read(b []byte) (n int, err error)

type Counter

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

func NewCounter

func NewCounter(i uint64) *Counter

func (*Counter) Add

func (c *Counter) Add(a any)

func (*Counter) Get

func (c *Counter) Get() uint64

func (*Counter) GetView

func (c *Counter) GetView() string

func (*Counter) Set

func (c *Counter) Set(a any)

type FlowReadWriter

type FlowReadWriter interface {
	io.ReadWriter
	ReadCount(*int) func()
	WriteCount(*int) func()
}

func NewFlowReadWriter

func NewFlowReadWriter(rw io.ReadWriter) FlowReadWriter

type FlowReader

type FlowReader interface {
	io.Reader
	Count(*int) func()
}

func NewFlowReader

func NewFlowReader(r io.Reader) FlowReader

type FlowWriter

type FlowWriter interface {
	io.Writer
	Count(*int) func()
}

func NewFlowWriter

func NewFlowWriter(w io.Writer) FlowWriter

type IOCounter

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

func NewIOCounter

func NewIOCounter(r, w uint64) *IOCounter

func (*IOCounter) Add

func (c *IOCounter) Add(r, w any)

func (*IOCounter) Get

func (c *IOCounter) Get() (r, w uint64)

func (*IOCounter) GetView

func (c *IOCounter) GetView() (r, w string)

func (*IOCounter) Set

func (c *IOCounter) Set(r, w any)

type MultiplexIO

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

func NewMultiplexIO

func NewMultiplexIO(rwc io.ReadWriteCloser) *MultiplexIO

func (*MultiplexIO) Close

func (mio *MultiplexIO) Close() error

func (*MultiplexIO) ReadMsg

func (mio *MultiplexIO) ReadMsg() ([]byte, uint32, uint32, error)

func (*MultiplexIO) WriteMsg

func (mio *MultiplexIO) WriteMsg(b []byte, rid, lid uint32) error

func (*MultiplexIO) WriteMsgWithPreSize

func (mio *MultiplexIO) WriteMsgWithPreSize(b, pre []byte, rid, lid uint32, size int) error

func (*MultiplexIO) WriteMsgWithSize

func (mio *MultiplexIO) WriteMsgWithSize(b []byte, rid, lid uint32, size int) error

Jump to

Keyboard shortcuts

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