decoder

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 7 Imported by: 11 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder accepts an io.Reader input and decodes message events from it.

func New

func New(in io.Reader) *Decoder

New returns a Decoder with a growing buffer. Lines are limited to bufio.MaxScanTokenSize - 1.

func NewSize

func NewSize(in io.Reader, bufferSize int) *Decoder

NewSize returns a Decoder with a fixed buffer size.

func (*Decoder) Decode

func (d *Decoder) Decode() (*base.MessageEvent, error)

Decode reads the input stream and parses events from it. Any error while reading is returned.

func (*Decoder) Retry

func (d *Decoder) Retry() time.Duration

Retry returns the to wait before attempting to reconnect to the event source.

Jump to

Keyboard shortcuts

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