Network-NineP-0.1.1: High-level abstraction over 9P protocol

PortabilityI'm too young to die
StabilityUltra-Violence
Safe HaskellNone

Network.NineP.Server

Description

Listening on sockets for the incoming requests.

Synopsis

Documentation

data NineFile m Source

Constructors

RegularFile 

Fields

read :: Word64 -> Word32 -> ErrorT NineError m ByteString
 
write :: Word64 -> ByteString -> ErrorT NineError m Word32
 
remove :: m ()
 
stat :: m Stat

The directory stat must return only stat for ..

wstat :: Stat -> m ()
 
version :: m Word32
 
Directory 

Fields

getFiles :: m [NineFile m]

A callback to get the list of the files this directory contains. Must not contain . and .. entries.

parent :: m (Maybe (NineFile m))
 
descend :: String -> ErrorT NineError m (NineFile m)

A callback to address a specific file by its name. . and .. are handled in the library.

remove :: m ()
 
stat :: m Stat

The directory stat must return only stat for ..

wstat :: Stat -> m ()
 
version :: m Word32
 

boringFile :: (Monad m, EmbedIO m) => String -> NineFile mSource

A dumb file that can't do anything.

boringDir :: (Monad m, EmbedIO m) => String -> [(String, NineFile m)] -> NineFile mSource

A dumb directory that can't do anything but provide the files it contains.

data Config m Source

Server configuration.

Constructors

Config 

Fields

root :: NineFile m

The / directory of the hosted filesystem.

addr :: String

The listening address. The syntax is taken from Plan 9 operating system and has the form unix!/path/to/socket for unix socket files, and tcp!hostname!port for tcp sockets.

monadState :: Content m

The initial state for the user-supplied monad. Use Void for IO.

run9PServer :: EmbedIO m => Config m -> IO ()Source

Run the actual server