-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A SFTP client tool for secure file transfer operations -- -- Hsftp is a command-line tool for secure file transfer operations @package hsftp @version 1.3.1 -- | This module parses a YAML file with configuration options. -- -- Example of conf.yaml: -- --
--   remote:
--       hostname: sftp.domain.com
--       port: 22
--       username: username
--       password: password
--       known_hosts: /home/user/.ssh/known_hosts
--   
module Config -- | Represents the configuration settings for the application. data Config Config :: String -> Int -> String -> String -> FilePath -> Config -- | The host address of the server. [configHost] :: Config -> String -- | The port number to connect to. [configPort] :: Config -> Int -- | The username for authentication. [configUser] :: Config -> String -- | The password for authentication. [configPassword] :: Config -> String -- | The file path to the known hosts file. [configKnownHosts] :: Config -> FilePath -- | Create a Config from a YamlConfig. -- -- This function takes a YamlConfig and extracts the necessary -- fields to create a Config object. It returns an IO -- action that produces the resulting Config. mkConfig :: YamlConfig -> IO Config instance GHC.Show.Show Config.Config instance GHC.Show.Show Config.Remote instance GHC.Show.Show Config.YamlConfig instance Data.Aeson.Types.FromJSON.FromJSON Config.YamlConfig instance Data.Aeson.Types.FromJSON.FromJSON Config.Remote -- | This module holds the available options for the hedictl utility. module Options data Direction Up :: Direction Down :: Direction -- | Represents the options for the program. data Options Options :: FilePath -> String -> [String] -> Direction -> FilePath -> FilePath -> Maybe FilePath -> Int -> Bool -> [FilePath] -> Options -- | Path to the configuration file. [conf] :: Options -> FilePath -- | Filter files by date (see toDate for details on supported -- formats). [fromDate] :: Options -> String -- | Filter files by extensions. [extensions] :: Options -> [String] -- | Direction of the transfer. [direction] :: Options -> Direction -- | Transfer from this folder (folder must exist). [src] :: Options -> FilePath -- | Transfer to this folder (folder must exist). [dst] :: Options -> FilePath -- | Archive into this folder after successful upload (folder must exist). [archive] :: Options -> Maybe FilePath -- | Verbose level. [verbose] :: Options -> Int -- | Do a dry-run (no-op) transfer. [dryRun] :: Options -> Bool -- | List of files and/or folders. [others] :: Options -> [FilePath] instance GHC.Show.Show Options.Direction instance GHC.Classes.Eq Options.Direction instance Data.Data.Data Options.Direction instance GHC.Show.Show Options.Options instance Data.Data.Data Options.Options -- | This module holds the command-line options accepted by executable. module CmdOptions -- | Defines the command line options for the hsftp program. options :: Mode (CmdArgs Options) -- | This module holds the environment variables used by the program. module Reader -- | Represents the environment configuration for the SFTP client. data Env Env :: String -> Int -> String -> String -> FilePath -> FilePath -> FilePath -> [ByteString] -> Maybe FilePath -> Integer -> Bool -> Env -- | The hostname of the SFTP server. [hostName] :: Env -> String -- | The port number to connect to. [port] :: Env -> Int -- | The username for authentication. [user] :: Env -> String -- | The password for authentication. [password] :: Env -> String -- | The path to the known hosts file. [knownHosts] :: Env -> FilePath -- | The source file path for transfer. [transferFrom] :: Env -> FilePath -- | The destination file path for transfer. [transferTo] :: Env -> FilePath -- | The list of file extensions to transfer. [transferExtensions] :: Env -> [ByteString] -- | Optional path to archive transferred files. [archiveTo] :: Env -> Maybe FilePath -- | The date for filtering files to transfer. [date] :: Env -> Integer -- | Whether or not to perform the actual transfer. [noOp] :: Env -> Bool type ReaderIO = ReaderT Env IO -- | This module provides utility functions for file, date and time -- manipulation. module Util -- | Create a file if it does not exist. -- -- Example usage: -- --
--   >>> createFile "test.txt"
--   
createFile :: FilePath -> IO () -- | Convert a string to seconds since Epoch. The input string should be in -- the format %F %R %Z (YYYY-MM-DD HH-mm and abbreviated time zone name). -- If the parsing fails, it defaults to the beginning of Epoch (i.e., -- zero). -- -- Example usage: -- --
--   >>> toDate "2022-01-01 12:00 UTC"
--   2022-01-01 12:00:00 UTC
--   
toDate :: String -> UTCTime -- | Convert a UTCTime value to seconds since Epoch. -- -- Example usage: -- --
--   >>> toEpoch (UTCTime (fromGregorian 2022 01 01) (secondsToDiffTime 0))
--     1640995200
--   
toEpoch :: UTCTime -> Integer -- | This module holds a collection of supported commands. module Commands -- | Download files from a remote server using SFTP. Both remote and local -- folders must exist. The function returns the number of files -- downloaded. download :: ReaderIO Int -- | Upload files to a remote server using SFTP. Both remote and local -- folders must exist. The function returns the number of files uploaded. upload :: ReaderIO Int