butler-0.0.1.0: At your service.
Safe HaskellSafe-Inferred
LanguageGHC2021

Butler.Core.File

Description

This module contains the file system logic.

Synopsis

File system data types

data Entry #

Entry is the base element of a file system.

Constructors

File File 
Directory Directory 

Instances

Instances details
ToJSON Entry # 
Instance details

Defined in Butler.Core.File

From Entry FileName # 
Instance details

Defined in Butler.Core.File

Methods

from :: Entry -> FileName #

data File #

Instances

Instances details
ToJSON File # 
Instance details

Defined in Butler.Core.File

data Directory #

Instances

Instances details
ToJSON Directory # 
Instance details

Defined in Butler.Core.File

readRootDirectory :: MonadIO m => RawFilePath -> m (Maybe Directory) #

Read the root directory content, return Nothing when the file path is not a directory. You must call this function to get the first directory.

Directory API

getRootDir :: Directory -> Directory #

Return the outer most directory.

data FileName #

FileName are provided by the user, they must not begin or end with a /.

Instances

Instances details
FromJSON FileName # 
Instance details

Defined in Butler.Core.File

ToJSON FileName # 
Instance details

Defined in Butler.Core.File

IsString FileName # 
Instance details

Defined in Butler.Core.File

Monoid FileName # 
Instance details

Defined in Butler.Core.File

Semigroup FileName # 
Instance details

Defined in Butler.Core.File

Show FileName # 
Instance details

Defined in Butler.Core.File

Eq FileName # 
Instance details

Defined in Butler.Core.File

Ord FileName # 
Instance details

Defined in Butler.Core.File

ToHtml FileName # 
Instance details

Defined in Butler.Core.File

Methods

toHtml :: forall (m :: Type -> Type). Monad m => FileName -> HtmlT m () #

toHtmlRaw :: forall (m :: Type -> Type). Monad m => FileName -> HtmlT m () #

From Entry FileName # 
Instance details

Defined in Butler.Core.File

Methods

from :: Entry -> FileName #

From FileName FileLoc # 
Instance details

Defined in Butler.Core.File

Methods

from :: FileName -> FileLoc #

From FileName Text # 
Instance details

Defined in Butler.Core.File

Methods

from :: FileName -> Text #

From FileName RawFilePath # 
Instance details

Defined in Butler.Core.File

Methods

from :: FileName -> RawFilePath #

From RawFilePath FileName # 
Instance details

Defined in Butler.Core.File

Methods

from :: RawFilePath -> FileName #

File API

deleteFile :: MonadIO m => Directory -> File -> m () #

Rename/Move API

moveEntry :: MonadIO m => Directory -> Directory -> Entry -> m () #

External API

data FileLoc #

The absolute location of a directory, for remote user.

Instances

Instances details
FromJSON FileLoc # 
Instance details

Defined in Butler.Core.File

ToJSON FileLoc # 
Instance details

Defined in Butler.Core.File

Monoid FileLoc # 
Instance details

Defined in Butler.Core.File

Semigroup FileLoc # 
Instance details

Defined in Butler.Core.File

Show FileLoc # 
Instance details

Defined in Butler.Core.File

Serialise FileLoc # 
Instance details

Defined in Butler.Core.File

From FileLoc Text # 
Instance details

Defined in Butler.Core.File

Methods

from :: FileLoc -> Text #

From FileName FileLoc # 
Instance details

Defined in Butler.Core.File

Methods

from :: FileName -> FileLoc #

getFileLoc :: Directory -> Maybe File -> FileLoc #

Get the absolute location of a directory.

Upload API

Mime API