gopher

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TEXT      = gopherItemType('0') // Plain text file
	MENU      = gopherItemType('1') // Gopher submenu
	PHONEBOOK = gopherItemType('2') // CCSO flat database; other databases
	ERROR     = gopherItemType('3') // Error message
	BINHEX    = gopherItemType('4') // Macintosh BinHex file
	ARCHIVE   = gopherItemType('5') // Archive file (zip, tar, gzip, etc)
	UUENCODED = gopherItemType('6') // UUEncoded file
	INDEX     = gopherItemType('7') // Search query
	TELNET    = gopherItemType('8') // Telnet session
	BINARY    = gopherItemType('9') // Binary file
	GIF       = gopherItemType('g') // GIF format graphics file
	IMAGE     = gopherItemType('I') // Image file
	DOC       = gopherItemType('d') // Word processing document (ps, pdf, doc, etc)
	AUDIO     = gopherItemType('s') // Sound file
	VIDEO     = gopherItemType(';') // Video file
	HTML      = gopherItemType('h') // HTML document
	INFO      = gopherItemType('i') // Info line
	REDUNDANT = gopherItemType('+') // Redundant server
	TN3270    = gopherItemType('T') // Telnet to: tn3270 series server
	MIME      = gopherItemType('M') // MIME file (mbox, emails, etc)
	CALENDAR  = gopherItemType('c') // Calendar file
)

Variables

View Source
var TYPES_REGEXP = regexp.MustCompile(`^([0123456789gIds;hi+TMc])(.*?\s+)(((URL|TITLE):.*?)\s+)?([\w\d_\-.]+\s+\d+)$`)

Functions

This section is empty.

Types

type Handler

type Handler struct{}

func (*Handler) GetTemplatesFuncMap

func (f *Handler) GetTemplatesFuncMap(conn *ttconn.Connection) (tplFunc map[string]interface{}, err error)

func (*Handler) MaxQueryBytes

func (f *Handler) MaxQueryBytes() int

func (*Handler) ParseData

func (f *Handler) ParseData(conn *ttconn.Connection, inbuf []byte) (route string, extraData interface{}, err error)

func (*Handler) PostProcess

func (f *Handler) PostProcess(conn *ttconn.Connection, route string, extraData interface{}, input interface{}) (output interface{}, err error)

func (*Handler) Process

func (f *Handler) Process(conn *ttconn.Connection, route string, extraData interface{}, forceCacheUpdate bool) (output interface{}, err error)

func (*Handler) Read

func (f *Handler) Read(conn *ttconn.Connection) ([]byte, error)

func (*Handler) RegisterPrometheusMetrics

func (f *Handler) RegisterPrometheusMetrics() error

func (*Handler) ServeConn

func (f *Handler) ServeConn(conn *ttconn.Connection) error

func (*Handler) ServeCrontab

func (f *Handler) ServeCrontab(conn *ttconn.Connection, route string, routeExtraData interface{}) error

func (*Handler) Write

func (f *Handler) Write(conn *ttconn.Connection, output interface{}) (n int64, err error)

type Query

type Query struct {
	Selector string
	ExtData  string
}

func ParseQuery

func ParseQuery(line string) (*Query, error)

Jump to

Keyboard shortcuts

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