2020-10-24 19:15:32 +00:00
|
|
|
package gemini
|
2020-09-25 23:09:49 +00:00
|
|
|
|
2020-09-26 20:52:14 +00:00
|
|
|
import (
|
2020-10-14 00:10:04 +00:00
|
|
|
"errors"
|
2020-09-26 20:52:14 +00:00
|
|
|
)
|
|
|
|
|
2020-10-27 23:21:33 +00:00
|
|
|
var crlf = []byte("\r\n")
|
2020-09-25 23:09:49 +00:00
|
|
|
|
2020-10-14 00:10:04 +00:00
|
|
|
// Errors.
|
|
|
|
var (
|
2020-11-05 20:27:12 +00:00
|
|
|
ErrInvalidURL = errors.New("gemini: invalid URL")
|
2020-12-18 06:41:14 +00:00
|
|
|
ErrInvalidRequest = errors.New("gemini: invalid request")
|
2020-11-05 20:27:12 +00:00
|
|
|
ErrInvalidResponse = errors.New("gemini: invalid response")
|
2021-02-15 04:58:28 +00:00
|
|
|
|
|
|
|
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
|
|
|
|
// when the response status code does not permit a body.
|
|
|
|
ErrBodyNotAllowed = errors.New("gemini: response status code does not allow body")
|
|
|
|
|
|
|
|
// ErrServerClosed is returned by the Server's Serve and ListenAndServe
|
|
|
|
// methods after a call to Shutdown or Close.
|
|
|
|
ErrServerClosed = errors.New("gemini: server closed")
|
2021-02-15 05:36:08 +00:00
|
|
|
|
|
|
|
// ErrAbortHandler is a sentinel panic value to abort a handler.
|
|
|
|
// While any panic from ServeGemini aborts the response to the client,
|
|
|
|
// panicking with ErrAbortHandler also suppresses logging of a stack
|
|
|
|
// trace to the server's error log.
|
|
|
|
ErrAbortHandler = errors.New("net/http: abort Handler")
|
2020-10-14 00:10:04 +00:00
|
|
|
)
|