Documentation ¶
Index ¶
- Variables
- func AssertMessageEqual(t testing.TB, a, b eventstream.Message, msg ...interface{})
- func MarshalEventPayload(payloadMarshaler protocol.PayloadMarshaler, v interface{}) []byte
- func SetupEventStreamSession(t *testing.T, handler http.Handler, h2 bool) (sess *session.Session, cleanupFn func(), err error)
- type ServeEventStream
Constants ¶
This section is empty.
Variables ¶
var EventExceptionTypeHeader = eventstream.Header{ Name: messageTypeHeader, Value: eventstream.StringValue(exceptionMessageType), }
EventExceptionTypeHeader is an event exception type header for specifying an event is an exception type.
var EventMessageTypeHeader = eventstream.Header{ Name: messageTypeHeader, Value: eventstream.StringValue(eventMessageType), }
EventMessageTypeHeader is an event message type header for specifying an event is an message type.
Functions ¶
func AssertMessageEqual ¶ added in v1.3.2
func AssertMessageEqual(t testing.TB, a, b eventstream.Message, msg ...interface{})
AssertMessageEqual compares to event stream messages, and determines if they are equal. Will trigger an testing Error if components of the message are not equal.
func MarshalEventPayload ¶
func MarshalEventPayload( payloadMarshaler protocol.PayloadMarshaler, v interface{}, ) []byte
MarshalEventPayload marshals a SDK API shape into its associated wire protocol payload.
func SetupEventStreamSession ¶
func SetupEventStreamSession( t *testing.T, handler http.Handler, h2 bool, ) (sess *session.Session, cleanupFn func(), err error)
SetupEventStreamSession creates a HTTP server SDK session for communicating with that server to be used for EventStream APIs. If HTTP/2 is enabled the server/client will only attempt to use HTTP/2.
Types ¶
type ServeEventStream ¶
type ServeEventStream struct { T *testing.T BiDirectional bool 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)