Safe Haskell | None |
---|---|
Language | Haskell98 |
Network.Protocol.HTTP.DAV
Contents
Synopsis
- newtype DAVT (m :: Type -> Type) a = DAVT {
- runDAVT :: ExceptT String (StateT DAVContext m) a
- evalDAVT :: MonadIO m => DAVURL -> DAVT m a -> m (Either String a)
- withDAVContext :: MonadIO m => DAVURL -> (DAVContext -> m a) -> m a
- runDAVContext :: MonadIO m => DAVContext -> DAVT m a -> m (Either String a, DAVContext)
- setCreds :: forall (m :: Type -> Type). MonadIO m => ByteString -> ByteString -> DAVT m ()
- setDepth :: forall (m :: Type -> Type). MonadIO m => Maybe Depth -> DAVT m ()
- setResponseTimeout :: forall (m :: Type -> Type). MonadIO m => Maybe Int -> DAVT m ()
- setUserAgent :: forall (m :: Type -> Type). MonadIO m => ByteString -> DAVT m ()
- data DAVContext = DAVContext {}
- caldavReportM :: forall (m :: Type -> Type). MonadIO m => DAVT m Document
- delContentM :: forall (m :: Type -> Type). MonadIO m => DAVT m ()
- getPropsM :: forall (m :: Type -> Type). MonadIO m => DAVT m Document
- getContentM :: forall (m :: Type -> Type). MonadIO m => DAVT m (Maybe ByteString, ByteString)
- withContentM :: forall (m :: Type -> Type) a. MonadIO m => (Response BodyReader -> IO a) -> DAVT m a
- mkCol :: forall (m :: Type -> Type). (MonadIO m, MonadBase IO m, MonadCatch m) => DAVT m Bool
- moveContentM :: forall (m :: Type -> Type). MonadIO m => ByteString -> DAVT m ()
- putPropsM :: forall (m :: Type -> Type). MonadIO m => Document -> DAVT m ()
- putContentM :: forall (m :: Type -> Type). MonadIO m => (Maybe ByteString, ByteString) -> DAVT m ()
- putContentM' :: forall (m :: Type -> Type). MonadIO m => (Maybe ByteString, RequestBody) -> DAVT m ()
- withLockIfPossible :: forall (m :: Type -> Type) a. (MonadIO m, MonadBase IO m) => Bool -> DAVT m a -> DAVT m a
- withLockIfPossibleForDelete :: forall (m :: Type -> Type) a. (MonadIO m, MonadBase IO m) => Bool -> DAVT m a -> DAVT m a
- inDAVLocation :: forall (m :: Type -> Type) a. MonadIO m => (String -> String) -> DAVT m a -> DAVT m a
- getDAVLocation :: forall (m :: Type -> Type). Monad m => DAVT m String
- mkDAVContext :: MonadIO m => DAVURL -> m DAVContext
- closeDAVContext :: MonadIO m => DAVContext -> m ()
- data DAVContext = DAVContext {}
- data Depth
- allowedMethods :: Lens' DAVContext [ByteString]
- baseRequest :: Lens' DAVContext Request
- basicpassword :: Lens' DAVContext ByteString
- basicusername :: Lens' DAVContext ByteString
- complianceClasses :: Lens' DAVContext [ByteString]
- depth :: Lens' DAVContext (Maybe Depth)
- httpManager :: Lens' DAVContext (Maybe Manager)
- lockToken :: Lens' DAVContext (Maybe ByteString)
- userAgent :: Lens' DAVContext ByteString
Documentation
newtype DAVT (m :: Type -> Type) a #
Instances
withDAVContext :: MonadIO m => DAVURL -> (DAVContext -> m a) -> m a #
runDAVContext :: MonadIO m => DAVContext -> DAVT m a -> m (Either String a, DAVContext) #
setCreds :: forall (m :: Type -> Type). MonadIO m => ByteString -> ByteString -> DAVT m () #
setUserAgent :: forall (m :: Type -> Type). MonadIO m => ByteString -> DAVT m () #
data DAVContext #
Constructors
DAVContext | |
Fields |
Instances
Default DAVContext # | |
Defined in Network.Protocol.HTTP.DAV Methods def :: DAVContext # | |
Monad m => MonadState DAVContext (DAVT m) # | |
Defined in Network.Protocol.HTTP.DAV Methods get :: DAVT m DAVContext # put :: DAVContext -> DAVT m () # state :: (DAVContext -> (a, DAVContext)) -> DAVT m a # |
getContentM :: forall (m :: Type -> Type). MonadIO m => DAVT m (Maybe ByteString, ByteString) #
Note that the entire request body is buffered in memory. To stream large files use withContentM instead.
withContentM :: forall (m :: Type -> Type) a. MonadIO m => (Response BodyReader -> IO a) -> DAVT m a #
moveContentM :: forall (m :: Type -> Type). MonadIO m => ByteString -> DAVT m () #
putContentM :: forall (m :: Type -> Type). MonadIO m => (Maybe ByteString, ByteString) -> DAVT m () #
Note that the entire request body is buffered in memory; not suitable for large files.
putContentM' :: forall (m :: Type -> Type). MonadIO m => (Maybe ByteString, RequestBody) -> DAVT m () #
To send a large file, pass eg a RequestBodyStream containing the file's content.
withLockIfPossible :: forall (m :: Type -> Type) a. (MonadIO m, MonadBase IO m) => Bool -> DAVT m a -> DAVT m a #
withLockIfPossibleForDelete :: forall (m :: Type -> Type) a. (MonadIO m, MonadBase IO m) => Bool -> DAVT m a -> DAVT m a #
inDAVLocation :: forall (m :: Type -> Type) a. MonadIO m => (String -> String) -> DAVT m a -> DAVT m a #
Normally, DAVT actions act on the url that is provided to eg, evalDAVT. Sometimes, it's useful to adjust the url that is acted on, while remaining in the same DAV session.
inLocation temporarily adjusts the url's path, while performing a DAVT action.
For example:
import System.FilePath.Posix -- posix for url path manipulation mkColRecursive d = do let parent = takeDirectory d when (parent /= d) $ mkColRecursive parent inDAVLocation (</> d) mkCol
Note that operations that modify the DAVContext (such as setCreds and setCreds) can be run inside davLocation, but will not have any effect on the calling DAVContext.
getDAVLocation :: forall (m :: Type -> Type). Monad m => DAVT m String #
Gets the path of the url that DAVT actions will act on.
mkDAVContext :: MonadIO m => DAVURL -> m DAVContext #
closeDAVContext :: MonadIO m => DAVContext -> m () #
Deprecated: deprecated because http-client deprecated closeManager
data DAVContext #
Constructors
DAVContext | |
Fields |
Instances
Default DAVContext # | |
Defined in Network.Protocol.HTTP.DAV Methods def :: DAVContext # | |
Monad m => MonadState DAVContext (DAVT m) # | |
Defined in Network.Protocol.HTTP.DAV Methods get :: DAVT m DAVContext # put :: DAVContext -> DAVT m () # state :: (DAVContext -> (a, DAVContext)) -> DAVT m a # |
httpManager :: Lens' DAVContext (Maybe Manager) #
lockToken :: Lens' DAVContext (Maybe ByteString) #
Orphan instances
Default DAVContext # | |
Methods def :: DAVContext # |