Documentation ¶
Index ¶
Constants ¶
View Source
const ( TextItem = '0' CCSONameserverItem = '2' ErrorItem = '3' BinHexItem = '4' DOSFileItem = '5' UuencodedFileItem = '6' FullTextSearchItem = '7' TelnetItem = '8' BinaryFileItem = '9' MirrorServerItem = '+' AlternateServerItem = '+' GIFFileItem = 'g' ImageItem = 'I' Telnet3270Item = 'T' HTMLItem = 'h' InfoMessage = 'i' SoundItem = 's' )
constants of all the standard and common item types
View Source
const ( UserDisplayStringColumn = 0 SelectorColumn = 1 DomainColumn = 2 PortColumn = 3 AdditionalColumns = 4 )
constants of all the defined columns in the gopher protocol
View Source
const ( ForbiddenError = "Forbidden" NotFoundError = "Not Found" InternalServerError = "Internal Server Error" )
constants of all the possible server errors (not defined in the gopher RFC)
Variables ¶
This section is empty.
Functions ¶
func ServeAndListen ¶
ServeAndListen create a TCP server on the specified addr and pass new connections to the handler.
Types ¶
type FileServerHandler ¶
type FileServerHandler struct { IP string Port uint16 Directory string // if ShowDotFiles is true, the server will also list and serve files // beginning with a dot (hidden files in UNIX systems). ShowDotFiles bool }
A FileServerHandler is a simple handler that serve static files from a directory. An empty FileServerHandler is a valid handler that will serve the current directory.
func (FileServerHandler) Handle ¶
func (srv FileServerHandler) Handle(r Request) Response
Handle the file server requests and return the file
type Item ¶
type Item struct { Type rune DisplayName string Selector string ServerAddr string AdditionalColumns []string }
Item represent an item on a gopher server
Click to show internal directories.
Click to hide internal directories.