sse

package
v0.0.0-...-6b7e659 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadContentType

type BadContentType struct {
	ContentType string
}

func (*BadContentType) Error

func (err *BadContentType) Error() string

type BadStatusCode

type BadStatusCode struct {
	StatusCode int
}

func (*BadStatusCode) Error

func (err *BadStatusCode) Error() string

type EndListener

type EndListener func()

type ErrListener

type ErrListener func(err error)

type EventSource

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

func NewEventSource

func NewEventSource(c *http.Client, urlStr string) *EventSource

func (*EventSource) AddHeader

func (s *EventSource) AddHeader(name, value string)

func (*EventSource) Close

func (s *EventSource) Close()

func (*EventSource) On

func (s *EventSource) On(event string, listener Listener)

func (*EventSource) OnEnd

func (s *EventSource) OnEnd(listener EndListener)

EndListener is called when the EventSource is closed and there will be no more events fired from it

func (*EventSource) OnError

func (s *EventSource) OnError(listener ErrListener)

func (*EventSource) Open

func (s *EventSource) Open()

type Listener

type Listener func(data string)

Jump to

Keyboard shortcuts

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