sse

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 11 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeStream

func ServeStream(w http.ResponseWriter, ch interface{}, l log.Logger)

Types

type Decoder

type Decoder struct {
	*Reader
}

func NewDecoder

func NewDecoder(r *bufio.Reader) *Decoder

func (*Decoder) Decode

func (dec *Decoder) Decode(v interface{}) error

Decode finds the next "data" field and decodes it into v

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Reader

type Reader struct {
	*bufio.Reader
}

func (*Reader) Read

func (r *Reader) Read() ([]byte, error)

type Stream

type Stream struct {
	Done chan struct{}
	// contains filtered or unexported fields
}

func NewStream

func NewStream(w http.ResponseWriter, ch interface{}, l log.Logger) *Stream

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) CloseWithError

func (s *Stream) CloseWithError(err error)

func (*Stream) Error

func (s *Stream) Error(err error)

func (*Stream) Serve

func (s *Stream) Serve()

func (*Stream) Wait

func (s *Stream) Wait()

Jump to

Keyboard shortcuts

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