Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MaxScanTokenSize defines max len of sse event
MaxScanTokenSize = 4096 * 1024
)
Variables ¶
View Source
var (
ErrClosed = errors.New("already closed")
)
Functions ¶
This section is empty.
Types ¶
type ReadCloser ¶
type ReadCloser struct {
// contains filtered or unexported fields
}
func NewReadCloser ¶
func NewReadCloser(r io.ReadCloser) *ReadCloser
NewReadCloser returns *Reader from wrapped reader r.
It starts routine during first Read(), the parseStarted routine returns when wrapped r is closed, or invalid event is parsed
func (*ReadCloser) Buffer ¶
func (r *ReadCloser) Buffer(buf []byte, max int)
Buffer defines buffer value for internal go routine io.Scanner
func (*ReadCloser) Close ¶
func (r *ReadCloser) Close() error
Close ask wrapped io.readCloser for Close
func (*ReadCloser) Read ¶
func (r *ReadCloser) Read() (*event.Event, error)
Read returns *Event read from EventReader r
func (*ReadCloser) SetContext ¶
func (r *ReadCloser) SetContext(ctx context.Context)
SetContext set reader context, it will replace default reader context, it can't be called after initial Read
Click to show internal directories.
Click to hide internal directories.