gemini

package module
v0.0.0-...-b9a4fe6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 12 Imported by: 0

README

libgemini

libgemini is a library for writing a gemini server in golang.

This library is a work in progress and will attempt to follow the latest changes to the gemini protocol specification.

Documentation

Index

Constants

View Source
const (
	StatusInput          = 10
	StatusSensitiveInput = 11

	StatusSuccess = 20

	StatusRedirect     = 30
	StatusRedirectPerm = 31

	StatusTempFailure       = 40
	StatusServerUnavailable = 41
	StatusCGIError          = 42
	StatusProxyError        = 43
	StatusSlowDown          = 44

	StatusPermFailure         = 50
	StatusNotFound            = 51
	StatusGone                = 52
	StatusProxyRequestRefused = 53
	StatusBadRequest          = 59

	StatusClientCertRequired      = 60
	StatusClientCertNotAuthorised = 61
	StatusClientCertNotValid      = 62
)
View Source
const DefaultHeaderSeparator = 0x20

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(addr, certFile, keyFile string, handler Handler) error

Types

type Handler

type Handler interface {
	Handle(r Request) Response
}

type Request

type Request struct {
	URL        url.URL
	TLSState   tls.ConnectionState
	RemoteAddr net.Addr
}

type Response

type Response struct {
	Header ResponseHeader
	Body   io.ReadCloser
}

func NewResponse

func NewResponse(status int, meta string, body io.ReadCloser) Response

func ParseResponse

func ParseResponse(s string) (*Response, error)

type ResponseHeader

type ResponseHeader struct {
	Status    int
	Meta      string
	Separator byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL