Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultHandler(tpl *template.Template, startpagetext string, assetList AssetList) http.HandlerFunc
- func FaviconHandler(favicondata []byte) http.HandlerFunc
- func FontHandler(woff2 bool, fontdata []byte) http.HandlerFunc
- func GeminiHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, assetList AssetList, ...) http.HandlerFunc
- func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, assetList AssetList, ...) http.HandlerFunc
- func JavaScriptHandler(jsdata []byte) http.HandlerFunc
- func ListenAndServe(bind, startpagefile string, robotsfile string, robotsdebug bool, ...) error
- func RobotsTxtHandler(robotstxtdata []byte) http.HandlerFunc
- func StyleHandler(styledata []byte) http.HandlerFunc
- type AssetList
- type Item
- type TemplateVariables
Constants ¶
const ( ITEM_TYPE_GEMINI_LINE = "" ITEM_TYPE_GEMINI_LINK = " =>" )
Variables ¶
var (
TermEscapeSGRPattern = regexp.MustCompile("�\\[\\d+(;\\d+)*m")
)
Functions ¶
func DefaultHandler ¶
func FaviconHandler ¶
func FaviconHandler(favicondata []byte) http.HandlerFunc
func FontHandler ¶
func FontHandler(woff2 bool, fontdata []byte) http.HandlerFunc
func GeminiHandler ¶
func GeminiHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, assetList AssetList, robotsdebug bool) http.HandlerFunc
func GopherHandler ¶
func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, assetList AssetList, robotsdebug bool) http.HandlerFunc
GopherHandler returns a Handler that proxies requests to the specified Gopher server as denoated by the first argument to the request path and renders the content using the provided template. The optional robots parameters points to a robotstxt.RobotsData struct to test user agents against a configurable robotst.txt file.
func JavaScriptHandler ¶
func JavaScriptHandler(jsdata []byte) http.HandlerFunc
func ListenAndServe ¶
func ListenAndServe(bind, startpagefile string, robotsfile string, robotsdebug bool, vipsconcurrency int) error
ListenAndServe creates a listening HTTP server bound to the interface specified by bind and sets up a Gopher to HTTP proxy proxying requests as requested and by default will prozy to a Gopher server address specified by uri if no servers is specified by the request. The robots argument is a pointer to a robotstxt.RobotsData struct for testing user agents against a configurable robots.txt file.
func RobotsTxtHandler ¶
func RobotsTxtHandler(robotstxtdata []byte) http.HandlerFunc
RobotsTxtHandler returns the contents of the robots.txt file if configured and valid.
func StyleHandler ¶
func StyleHandler(styledata []byte) http.HandlerFunc