Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBufferSize ¶
func WithBufferSize(bufsize int) func(*ChanReader)
func WithCloseFunc ¶
func WithCloseFunc(closeFunc func()) func(*ChanReader)
func WithErrorFunc ¶
func WithErrorFunc(errorFunc func(error)) func(*ChanReader)
Types ¶
type ChanReader ¶
type ChanReader struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, r io.Reader, mods ...func(*ChanReader)) *ChanReader
New returns a ChanReader, which will read from r until EOF or error, sending each read to a channel. If the provided context is cancelled, reads will terminate and the reader will be closed if it is an io.Closer. These behaviors can be overridden by various modifiers.
func (*ChanReader) ReadChan ¶
func (cr *ChanReader) ReadChan() <-chan []byte
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher(ctx context.Context, reader io.ReadCloser, mods ...func(chanReader *ChanReader)) *Publisher
func (*Publisher) SubscribePackets ¶
func (*Publisher) UnsubscribePackets ¶
Click to show internal directories.
Click to hide internal directories.