From cb7879c966a04f8a0b88237cf025bd39ecb9cd0f Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Wed, 24 Feb 2021 10:48:17 -0500 Subject: Add NewResponse function --- response.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/response.go b/response.go index 594fda2..d89fcb7 100644 --- a/response.go +++ b/response.go @@ -26,6 +26,15 @@ type Response struct { conn net.Conn } +// NewResponse returns a new response with the provided status, meta, and body. +func NewResponse(status Status, meta string, body io.ReadCloser) *Response { + return &Response{ + status: status, + meta: meta, + body: body, + } +} + // ReadResponse reads a Gemini response from the provided io.ReadCloser. func ReadResponse(r io.ReadCloser) (*Response, error) { resp := &Response{} -- cgit v1.2.3