Documentation ¶
Overview ¶
Package eventstreamtesting implements helper utilities for event stream protocol testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EventExceptionTypeHeader = eventstream.Header{ Name: eventstreamapi.MessageTypeHeader, Value: eventstream.StringValue(eventstreamapi.ExceptionMessageType), }
EventExceptionTypeHeader is an event exception type header for specifying an event is an exception type.
View Source
var EventMessageTypeHeader = eventstream.Header{ Name: eventstreamapi.MessageTypeHeader, Value: eventstream.StringValue(eventstreamapi.EventMessageType), }
EventMessageTypeHeader is an event message type header for specifying an event is an message type.
Functions ¶
Types ¶
type ServeEventStream ¶
type ServeEventStream struct { T *testing.T BiDirectional bool StaticResponse *StaticResponse Events []eventstream.Message ClientEvents []eventstream.Message ForceCloseAfter time.Duration // contains filtered or unexported fields }
ServeEventStream provides serving EventStream messages from a HTTP server to the client. The events are sent sequentially to the client without delay.
func (ServeEventStream) ServeHTTP ¶
func (s ServeEventStream) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves an HTTP client request
type StaticResponse ¶
StaticResponse provides a way to define an HTTP event stream server that provides a fixed static response.
Click to show internal directories.
Click to hide internal directories.