Stability | experimental |
---|---|
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module implements a parser for gophermap files.
Example usage:
import Network.Gopher.Util.Gophermap import qualified Data.ByteString as B import Data.Attoparsec.ByteString main = do file <- B.readFile "gophermap" print $ parseOnly parseGophermap file
Synopsis
Documentation
data GophermapEntry Source #
A gophermap entry makes all values of a gopher menu item optional except for file type and description. When converting to a GopherMenuItem
, appropriate default values are used.
GophermapEntry GopherFileType ByteString (Maybe GophermapFilePath) (Maybe ByteString) (Maybe Integer) | file type, description, path, server name, port number |
Instances
Eq GophermapEntry Source # | |
Defined in Network.Gopher.Util.Gophermap (==) :: GophermapEntry -> GophermapEntry -> Bool # (/=) :: GophermapEntry -> GophermapEntry -> Bool # | |
Show GophermapEntry Source # | |
Defined in Network.Gopher.Util.Gophermap showsPrec :: Int -> GophermapEntry -> ShowS # show :: GophermapEntry -> String # showList :: [GophermapEntry] -> ShowS # |
data GophermapFilePath Source #
Wrapper around RawFilePath
to indicate whether it is
relative or absolute.
GophermapAbsolute RawFilePath | Absolute path starting with |
GophermapRelative RawFilePath | Relative path |
GophermapUrl RawFilePath | URL to another protocol starting with |
Instances
Eq GophermapFilePath Source # | |
Defined in Network.Gopher.Util.Gophermap (==) :: GophermapFilePath -> GophermapFilePath -> Bool # (/=) :: GophermapFilePath -> GophermapFilePath -> Bool # | |
Show GophermapFilePath Source # | |
Defined in Network.Gopher.Util.Gophermap showsPrec :: Int -> GophermapFilePath -> ShowS # show :: GophermapFilePath -> String # showList :: [GophermapFilePath] -> ShowS # |
type Gophermap = [GophermapEntry] Source #
gophermapToDirectoryResponse :: RawFilePath -> Gophermap -> GopherResponse Source #
Given a directory and a Gophermap contained within it, return the corresponding gopher menu response.