Documentation ¶
Index ¶
- Constants
- Variables
- func NewCloseError(err error) error
- func NewEventFromModelEvent(eventID int, event models.Event) (sse.Event, error)
- func NewInvalidPayloadError(payloadType string, protoErr error) error
- func NewRawEventSourceError(rawError error) error
- type EventSource
- type Hub
- type RawEventSource
Constants ¶
View Source
const MAX_PENDING_SUBSCRIBER_EVENTS = 1024
Variables ¶
View Source
var ( ErrUnrecognizedEventType = errors.New("unrecognized event type") ErrSourceClosed = errors.New("source closed") ErrNoData = errors.New("event with no data") )
View Source
var ErrHubAlreadyClosed = errors.New("hub already closed")
View Source
var ErrReadFromClosedSource = errors.New("read from closed source")
View Source
var ErrSendToClosedSource = errors.New("send to closed source")
View Source
var ErrSlowConsumer = errors.New("slow consumer")
View Source
var ErrSourceAlreadyClosed = errors.New("source already closed")
View Source
var ErrSubscribedToClosedHub = errors.New("subscribed to closed hub")
Functions ¶
func NewCloseError ¶
func NewEventFromModelEvent ¶
func NewInvalidPayloadError ¶
func NewRawEventSourceError ¶
Types ¶
type EventSource ¶
type EventSource interface { // Next reads the next event from the source. If the connection is lost, it // automatically reconnects. // // If the end of the stream is reached cleanly (which should actually never // happen), io.EOF is returned. If called after or during Close, // ErrSourceClosed is returned. Next() (models.Event, error) // Close releases the underlying response, interrupts any in-flight Next, and // prevents further calls to Next. Close() error }
EventSource provides sequential access to a stream of events.
func NewEventSource ¶
func NewEventSource(raw RawEventSource) EventSource
Click to show internal directories.
Click to hide internal directories.