gophermap

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Unlicense Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// CommentType is omitted from generated compatible gophermaps.
	CommentType types.Status = '#'

	// TitleType defines the title of a gophermap document.
	TitleType types.Status = '!'

	// HiddenType hides a link from the generated compatible gophermap.
	HiddenType types.Status = '-'

	// ExtensionType defines the gopher type to use for files in the current directory with a given extension.
	ExtensionType types.Status = ':'

	// UserListType generates a list of users with valid ~/public_gopher directories.
	UserListType types.Status = '~'

	// VHostListType generates a listing of virtual hosts.
	//
	// It is not supported in sliderule.
	VHostListType types.Status = '%'

	// InclusionType causes another gophermap to be included at this location.
	InclusionType types.Status = '='

	// DirListType stops parsing the current file and ends the generated gophermap with a listing of the current directory.
	DirListType types.Status = '*'

	// EndDocType ends the current gophermap file.
	EndDocType types.Status = '.'
)

Extensions to gopher types from Gophernicus.

Variables

This section is empty.

Functions

func ExtendMiddleware added in v1.6.0

func ExtendMiddleware(fsroot, urlroot string, settings *FileSystemSettings) sr.Middleware

func ListDir added in v1.3.0

func ListDir(dir string, location *url.URL, settings FileSystemSettings) (gopher.MapDocument, error)

ListDir builds a gopher menu representing the contents of a directory.

func Parse

func Parse(input io.Reader) (gopher.MapDocument, error)

Parse reads a gophermap document from a reader.

Types

type ExtendedMapDocument added in v1.3.0

type ExtendedMapDocument struct {
	Lines    []gopher.MapItem
	Location *url.URL
}

ExtendedMapDocument is a gophermap doc with gophernicus's extensions

These are documented at: gopher://gopher.gophernicus.org/0/docs/README.Gophermap

func ParseExtended added in v1.3.0

func ParseExtended(input io.Reader, location *url.URL) (*ExtendedMapDocument, error)

ParseExtended parses a gophermap document including gophernicus extensions.

func (*ExtendedMapDocument) Compatible added in v1.3.0

func (edoc *ExtendedMapDocument) Compatible(cwd string, settings FileSystemSettings) (gopher.MapDocument, string, error)

Compatible builds a standards-compliant gophermap from the current extended menu.

type FileSystemSettings added in v1.3.0

type FileSystemSettings struct {
	ParseExtended bool
	Exec          bool
	ListUsers     bool
	DirMaps       []string
	DirTag        string
}

type InvalidLine

type InvalidLine int

InvalidLine is returned from Parse when the reader contains a line which is invalid gophermap.

func (InvalidLine) Error

func (il InvalidLine) Error() string

Error implements the error interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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