aboutsummaryrefslogtreecommitdiff
path: root/response.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-21 18:52:04 -0500
committerAdnan Maolood <[email protected]>2021-02-21 18:52:06 -0500
commit2c64db3863cc6ba3c930d43a3a6b8ee60f3263fb (patch)
treedff42af8b6f62ef609c06762e75c2d4ff10b9bfe /response.go
parentclient: Remove Timeout (diff)
downloadgo-gemini-2c64db3863cc6ba3c930d43a3a6b8ee60f3263fb.tar.xz
go-gemini-2c64db3863cc6ba3c930d43a3a6b8ee60f3263fb.zip
Rename ResponseWriter.MediaType to SetMediaType
Diffstat (limited to 'response.go')
-rw-r--r--response.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/response.go b/response.go
index 1090ed5..1abe47c 100644
--- a/response.go
+++ b/response.go
@@ -160,18 +160,18 @@ func (r *Response) Write(w io.Writer) error {
// A ResponseWriter may not be used after the Handler.ServeGemini method
// has returned.
type ResponseWriter interface {
- // MediaType sets the media type that will be sent by Write for a
+ // SetMediaType sets the media type that will be sent by Write for a
// successful response. If no media type is set, a default of
// "text/gemini; charset=utf-8" will be used.
//
// Setting the media type after a call to Write or WriteHeader has
// no effect.
- MediaType(string)
+ SetMediaType(string)
// Write writes the data to the connection as part of a Gemini response.
//
// If WriteHeader has not yet been called, Write calls WriteHeader with
- // StatusSuccess and the media type set in MediaType before writing the data.
+ // StatusSuccess and the media type set in SetMediaType before writing the data.
// If no media type was set, Write uses a default media type of
// "text/gemini; charset=utf-8".
Write([]byte) (int, error)
@@ -181,7 +181,7 @@ type ResponseWriter interface {
//
// If WriteHeader is not called explicitly, the first call to Write
// will trigger an implicit call to WriteHeader with a successful
- // status code and the media type set in MediaType.
+ // status code and the media type set in SetMediaType.
//
// The provided code must be a valid Gemini status code.
// The provided meta must not be longer than 1024 bytes.
@@ -210,7 +210,7 @@ func newResponseWriter(w io.Writer) *responseWriter {
}
}
-func (w *responseWriter) MediaType(mediatype string) {
+func (w *responseWriter) SetMediaType(mediatype string) {
w.mediatype = mediatype
}