func SavePing(data [8]byte) { frame := map[string]interface{}{ "FrameMethod": "Ping", "Data": data, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveSettingsFrame(settings []http2.Setting) { frame := map[string]interface{}{ "FrameMethod": "SettingsFrame", "Settings": settings, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveWindowUpdateFrame(streamId uint32, incr uint32) { frame := map[string]interface{}{ "FrameMethod": "WindowUpdateFrame", "StreamID": streamId, "Incr": incr, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveDataFrame(streamID uint32, endStream bool, data []byte) { frame := map[string]interface{}{ "FrameMethod": "DataFrame", "StreamID": streamID, "EndStream": endStream, "Data": util.ToBase64(data), "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveResetFrame(streamID uint32, errorCode uint32) { frame := map[string]interface{}{ "FrameMethod": "ResetFrame", "StreamID": streamID, "ErrorCode": errorCode, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveRawFrame(frameType, flags uint8, streamID uint32, payload []byte) { frame := map[string]interface{}{ "FrameMethod": "RawFrame", "FrameType": frameType, "Flags": flags, "StreamID": streamID, "Payload": util.ToBase64(payload), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SavePriorityFrame(streamId, streamDep uint32, weight uint8, exclusive bool) { frame := map[string]interface{}{ "FrameMethod": "PriorityFrame", "StreamID": streamId, "StreamDep": streamDep, "Weight": weight, "Exclusive": exclusive, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SaveHeadersFrame(streamId uint32, headers map[string]string, endStream bool, endHeaders bool) { frame := map[string]interface{}{ "FrameMethod": "HeadersFrame", "StreamID": streamId, "Headers": headers, "EndStream": endStream, "EndHeaders": endHeaders, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }
func SavePushPromiseFrame(streamID uint32, promiseID uint32, blockFragment []byte, endHeaders bool, padLength uint8) { frame := map[string]interface{}{ "FrameMethod": "PushPromiseFrame", "StreamID": streamID, "PromiseID": promiseID, "BlockFragment": blockFragment, "EndHeaders": endHeaders, "PadLength": padLength, "Time": time.Now().Format(time.RFC3339), } out := util.ToJSON(frame) WriteToReplayFile(out) }