Versions in this module Expand all Collapse all v0 v0.4.0 Jan 28, 2023 Changes in this version + func InsertCarriageReturn(in []byte) []byte v0.3.1 Jan 14, 2023 v0.3.0 Dec 8, 2022 Changes in this version type Client + Logger io.Writer v0.2.0 Dec 7, 2022 Changes in this version type Status + func (s Status) Error(err error) Response + func (s Status) Response(mime string) Response v0.1.0 Dec 2, 2022 Changes in this version type Server + Logger io.Writer v0.0.1 Dec 1, 2022 Changes in this version + const DefaultAddress + const Header + const Header2 + const Header3 + const Link + const Pre + const ProxyRefused + const Quote + const Text + const UL + var ErrParse = errors.New("Parsing error") + var ErrResponseTooLarge = errors.New("Payload larger than defined ReadSize") + var ErrTimeout = errors.New("gemini client timeout") + var ErrWrongProtocol = errors.New("Unsupported protocol") + type Client struct + ReadSize int64 + ReadTimeout time.Duration + func (c Client) Get(u *url.URL) ([]byte, error) + type Dialer interface + Dial func(network, addr string) (net.Conn, error) + type Handler func(*url.URL, *tls.Conn) Response + type Lines []string + func (l *Lines) Header(level int, line string) + func (l *Lines) Line(line ...string) + func (l *Lines) Link(address string) + func (l *Lines) LinkDesc(address, description string) + func (l *Lines) Pre(lines ...string) + func (l *Lines) Quote(quote string) + func (l *Lines) UL(lines ...string) + type Response interface + Bytes func() []byte + String func() string + type ResponseFormat struct + Mime string + func (resp ResponseFormat) Bytes() []byte + func (resp ResponseFormat) String() string + type ResponsePlain []byte + func (resp ResponsePlain) Bytes() []byte + func (resp ResponsePlain) String() string + type ResponseRead struct + Content io.ReadCloser + Mime string + Name string + func (r ResponseRead) Bytes() []byte + func (r ResponseRead) String() string + type Server struct + Address string + Cert []byte + Key []byte + ReadLimit int64 + Ready chan byte + Shutdown chan byte + ShutdownCompleted chan byte + func GetServer(address string, cert, key []byte) *Server + func (s *Server) Run() error + type Status uint8 + const BadRequest + const CGIError + const CertificateNotAuthorised + const CertificateNotValid + const ClientCertificateRequired + const Gone + const Input + const NotFound + const PermanentFailure + const ProxyError + const ProxyRequestRefused + const RedirectPermanent + const RedirectTemporary + const SensitiveInput + const ServerUnavailable + const SlowDown + const Success + const TemporaryFailure + func ParseResponse(response []byte) (status Status, mime string, err error) + func (i Status) String() string