1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-09-19 18:53:43 +02:00
Commit Graph

47 Commits

Author SHA1 Message Date
adnano
6741248fe4 Remove ResponseWriter.Hijack method 2021-02-24 08:22:12 -05:00
adnano
6a0151c60b Implement TimeoutHandler by wrapping ResponseWriter 2021-02-24 08:18:23 -05:00
adnano
36a67255e0 Make ResponseWriter an interface
Make ResponseWriter an interface with an unexported method. Implementors
must embed a ResponseWriter from elsewhere. This gives us the
flexibility of an interface while allowing us to add new methods in the
future.
2021-02-24 00:13:46 -05:00
adnano
5bb9ae237d Unexport NewResponseWriter 2021-02-23 22:02:47 -05:00
adnano
29a2789434 Reimplement TimeoutHandler 2021-02-23 21:59:16 -05:00
adnano
b21522f6cb response: Change field names 2021-02-23 21:51:42 -05:00
adnano
ea7415e9af Add ResponseWriter.Hijack method 2021-02-23 21:36:29 -05:00
adnano
d3856730ab ResponseWriter: Add TLS and Conn methods 2021-02-23 20:59:04 -05:00
adnano
5641fb7415 Move I/O utilities to io.go 2021-02-23 20:49:55 -05:00
adnano
06d65b8154 Make ResponseWriter a struct
Make ResponseWriter a struct again so that it can be extended in a
backwards-compatible way.
2021-02-23 20:41:16 -05:00
adnano
4d7bb87110 Update documentation 2021-02-23 18:45:58 -05:00
adnano
8b7bd5b2d7 Make Response an io.ReadCloser 2021-02-23 17:50:47 -05:00
adnano
6d49b91ab7 response: Add Close method 2021-02-23 17:32:23 -05:00
adnano
b2bbb83827 response: Add Conn and TLS methods 2021-02-23 16:36:17 -05:00
adnano
a0d03c9088 response: Remove TLS field 2021-02-23 15:29:27 -05:00
adnano
ff53535185 Rename ResponseWriter.MediaType to SetMediaType 2021-02-21 18:52:06 -05:00
adnano
122fd434d6 Move Flush back to ResponseWriter 2021-02-21 16:06:56 -05:00
adnano
9318ba666b Make Status a type
Using a type is better than using an integer.
2021-02-20 16:16:32 -05:00
adnano
38e0b9b412 response: Implement Write method 2021-02-18 00:07:43 -05:00
adnano
de1e9f071a response: Rename statusCode to status 2021-02-18 00:06:34 -05:00
adnano
98d74f0b34 response: Ensure that only one header is written 2021-02-17 23:05:24 -05:00
adnano
b704a470a7 Redesign ResponseWriter interface 2021-02-17 13:36:16 -05:00
adnano
e4c50cf9ff Rename Meta to StatusText
Rename Meta to StatusText and support all status codes.
2021-02-17 12:06:43 -05:00
adnano
e23fd5217e Move ResponseWriter.Flush to Flusher interface 2021-02-17 11:44:13 -05:00
adnano
a852aa8ac8 Return ErrInvalidResponse on error reading status
Return ErrInvalidResponse when unable to read the response status code
instead of returning the error from strconv.
2021-02-15 19:18:23 -05:00
adnano
87e336e020 Remove faulty status code check in ReadResponse 2021-02-14 18:57:13 -05:00
adnano
715ce122ef Update Response documentation 2021-02-14 16:23:38 -05:00
adnano
5945788ccd Remove StatusClass* constants
Re-use the existing Status* constants and adjust StatusClass to return a
valid Status.
2021-02-14 16:01:39 -05:00
adnano
8c0ff0547d Make ResponseWriter an interface 2021-02-09 09:46:18 -05:00
adnano
ecfb9b2154 Use plain integers to represent status codes 2021-02-09 09:46:13 -05:00
adnano
d93adc7908 Make TLS field nil for unencrypted connections 2021-02-08 12:32:49 -05:00
adnano
c37abecc68 Remove unused field 2021-02-08 12:30:53 -05:00
adnano
456f2686bc Guarantee that (*Response).Body is not nil 2021-01-15 15:18:00 -05:00
adnano
106d0b1c1d Update comments 2021-01-10 01:07:38 -05:00
adnano
cd988d85ae Simplify ResponseWriter implementation 2021-01-10 00:50:35 -05:00
adnano
10c87efbc1 client: Close connection for unsuccessful responses 2020-12-22 19:22:01 -05:00
adnano
cc962586d4 Add ReadRequest and ReadResponse functions 2020-12-18 01:42:05 -05:00
adnano
b9a9b65d0b Expose Request.Write and Response.Read functions 2020-12-18 01:14:06 -05:00
adnano
2efc7a601b Remove Response.Request field 2020-12-18 00:19:53 -05:00
adnano
676fc4994c Don't guarantee that (*Response).Body is always non-nil 2020-11-08 18:38:08 -05:00
adnano
fc24256683 Guarantee that (*Response).Body is non-nil 2020-10-31 23:04:47 -04:00
adnano
06b2ffca4a Set default mimetype if META is empty 2020-10-31 20:32:38 -04:00
adnano
b25fdec389 Store a reference to the Request in Response 2020-10-28 00:21:27 -04:00
adnano
ab3ac68f6f Make (*Response).Body an io.ReadCloser 2020-10-27 19:16:55 -04:00
adnano
4beed7e90e Add (*ResponseWriter).WriteStatus function 2020-10-27 13:30:35 -04:00
adnano
6cccba3800 Rename repository to go-gemini 2020-10-24 15:15:32 -04:00
adnano
dda63807b5 Refactor 2020-10-21 17:07:28 -04:00