1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-12-04 17:58:14 +01:00
go-gemini/gemini.go

34 lines
1.1 KiB
Go
Raw Normal View History

2020-10-24 21:15:32 +02:00
package gemini
2020-09-26 01:09:49 +02:00
2020-09-26 22:52:14 +02:00
import (
2020-10-14 02:10:04 +02:00
"errors"
2020-09-26 22:52:14 +02:00
)
2020-10-28 00:21:33 +01:00
var crlf = []byte("\r\n")
2020-09-26 01:09:49 +02:00
2020-10-14 02:10:04 +02:00
// Errors.
var (
ErrInvalidRequest = errors.New("gemini: invalid request")
2020-11-05 21:27:12 +01:00
ErrInvalidResponse = errors.New("gemini: invalid response")
2021-02-21 15:27:12 +01:00
ErrCertificateExpired = errors.New("gemini: certificate expired")
// 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")
// 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.
2021-02-20 06:49:21 +01:00
ErrAbortHandler = errors.New("gemini: abort Handler")
// ErrHandlerTimeout is returned on ResponseWriter Write calls
// in handlers which have timed out.
ErrHandlerTimeout = errors.New("gemini: Handler timeout")
2020-10-14 02:10:04 +02:00
)