decoder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 8 Imported by: 7

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