modulepackage
0.0.0-20220901170151-952a8ecdb4b1
Repository: https://github.com/stryan/go-gopher.git
Documentation: pkg.go.dev
# README
Gopher protocol library for Golang
You almost certainly want the actual library at https://git.mills.io/prologic/go-gopher . This is just a patched together fork.
License
MIT
# Packages
No description provided by the author
# Functions
Error replies to the request with the specified error message.
FileServer returns a handler that serves Gopher requests with the contents of the file system rooted at root.
Get fetches a Gopher resource by URI.
GetItemType returns the Gopher Type of the given path.
Handle registers the handler for the given pattern in the DefaultServeMux.
HandleFunc registers the handler function for the given pattern in the DefaultServeMux.
ListenAndServe listens on the TCP network address addr and then calls Serve with handler to handle requests on incoming connections.
ListenAndServeTLS acts identically to ListenAndServe, except that it expects TLS connections.
NewServeMux allocates and returns a new ServeMux.
NotFound replies to the request with an resouce not found error item.
NotFoundHandler returns a simple request handler that replies to each request with a ``resource page not found'' reply.
ParseItem parses a line of text into an item.
# Constants
Item is an Audio file.
Item is a binary file! (*).
Item is a BinHexed Macintosh file.
CRLF is the delimiter used per line of response item.
DEFAULT is the default item type.
Item is a directory.
Item is a Document.
Item is DOS binary archive of some sort.
END represents the terminator used in directory responses.
Error.
Item is a file.
Item is a GIF format graphics file.
Item is a HTML document.
Item is some kind of image file.
Item is an Index-Search server.
Item is an informational message.
Item is a CSO phone-book server.
Item is a PNG Image.
Item is a redundant server.
TAB is the delimiter used to separate item response parts.
Item points to a text-based telnet session.
Item points to a text-based tn3270 session.
Item is a UNIX uuencoded file.
# Variables
DefaultServeMux is the default ServeMux used by Serve.
FileExtensions defines a mapping of known file extensions to gopher types.
LocalAddrContextKey is a context key.
MimeTypes defines a mapping of known mimetypes to gopher types.
ServerContextKey is a context key.
# Structs
Directory representes a Gopher Menu of Items.
Item describes an entry in a directory listing.
Request repsesnts an inbound request to a listening server.
Response represents a Gopher resource that Items contains a non-empty array of Item(s) for directory types, otherwise the Body contains the fetched resource (file, image, etc).
ServeMux is a Gopher request multiplexer.
Server defines parameters for running a Gopher server.
# Interfaces
A File is returned by a FileSystem's Open method and can be served by the FileServer implementation.
A FileSystem implements access to a collection of named files.
A Handler responds to a Gopher request.
A ResponseWriter interface is used by a Gopher handler to construct an Gopher response.
# Type aliases
A Dir implements FileSystem using the native file system restricted to a specific directory tree.
The HandlerFunc type is an adapter to allow the use of ordinary functions as Gopher handlers.
ItemType represents the type of an item.