Add NewResponse function
This commit is contained in:
parent
19bfca1cc3
commit
cb7879c966
@ -26,6 +26,15 @@ type Response struct {
|
|||||||
conn net.Conn
|
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.
|
// ReadResponse reads a Gemini response from the provided io.ReadCloser.
|
||||||
func ReadResponse(r io.ReadCloser) (*Response, error) {
|
func ReadResponse(r io.ReadCloser) (*Response, error) {
|
||||||
resp := &Response{}
|
resp := &Response{}
|
||||||
|
Loading…
Reference in New Issue
Block a user