From a46cecd5b33b853dc6ce60fed90c2c17fd8d5f3a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 6 Dec 2024 00:14:55 -0500 Subject: [PATCH] Add HTTPData struct --- http.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 http.go diff --git a/http.go b/http.go new file mode 100644 index 0000000..d7cf68e --- /dev/null +++ b/http.go @@ -0,0 +1,15 @@ +package step + +import "net/http" + +// HTTPData represents information about an ongoing HTTP request that is made +// available to templates as they are being executed. +type HTTPData struct { + // Res is like an http.ResponseWriter. + Res struct { + Header http.Header + WriteHeader func (statusCode int) + } + // Req is the HTTP request. + Req *http.Request +}