packages feed

criu-rpc 0.0.1 → 0.0.2

raw patch · 2 files changed

+14/−14 lines, 2 filesdep ~networkdep ~processdep ~proto-lensPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: network, process, proto-lens, text, unix

API changes (from Hackage documentation)

Files

criu-rpc.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                criu-rpc-version:             0.0.1+version:             0.0.2 synopsis:            CRIU RPC client. description:         Low level client for the CRIU RPC API. bug-reports:         https://github.com/wayofthepie/haskell-criu-rpc/issues@@ -29,10 +29,10 @@     base >=4.9 && <5     , criu-rpc-types >= 0.0.0.2 && < 1.0     , lens-family >= 1.2.1 && < 1.3-    , process-    , proto-lens-    , network-    , text-    , unix+    , process >= 1.4.0.0 && < 1.5+    , proto-lens >= 0.1.0.4 && < 0.1.1.0+    , network >= 2.6.0.0 && < 2.7+    , text >= 1.2.1.0 && < 1.3+    , unix >= 2.7.0.0 && < 2.8   hs-source-dirs:      src   default-language:    Haskell2010
src/Criu.hs view
@@ -29,13 +29,16 @@ import Control.Exception.Base (IOException, bracket, try) import GHC.Int import Lens.Family2 ((.~))-import Data.ProtoLens (build, decodeMessage, encodeMessage)+import Data.ProtoLens.Message (build)+import Data.ProtoLens.Encoding (decodeMessage, encodeMessage) import Proto.Criu.Rpc import Network.Socket (Family(AF_UNIX), SocketType(SeqPacket), SockAddr(SockAddrUnix), close, connect, socket) import Network.Socket.ByteString (recv, send) import System.Posix.IO import System.Posix.Types ++-------------------------------------------------------------------------------- {- $requests The simplest example of a call to CRIU is a __/check/__ request. For convenience this module re-exports some libraries used for building 'Criu_req's.@@ -87,7 +90,7 @@     Left (e :: IOException) -> pure . Left . show $ e  --- | Send request to a criu service. Takes a filepath to the criu service+-- | Send a request to a criu service. Takes a filepath to the criu service -- socket and a criu request. Returns an `Either` of the response or a -- `String` representing an error if there is an issue decoding the -- response from the criu service.@@ -104,13 +107,9 @@     (close)     (\sock -> f sock) ---- | Build some options.-criuOpts :: Int32 -> Int32 -> Criu_opts-criuOpts procId dirFd =-  build ((imagesDirFd .~ dirFd) . (pid .~ procId) . (shellJob .~ True))+-------------------------------------------------------------------------------- {- $requestbuilders-To build 'Criu_req''s you will need '.~' from "Lens.Family2", 'build' from+To build 'Criu_req''s you will need '.~' from "Lens.Family2", 'Data.ProtoLens.Message.build' from "Data.ProtoLens" and of course the lenses and types from "Proto.Criu.Rpc".  Above we saw a simple /check/ request, the next example is a /dump/ request. This one is@@ -162,6 +161,7 @@ dumpRequestOpts :: Fd -> Int32 -> Criu_opts dumpRequestOpts fd procId =   build ((imagesDirFd .~ (fromIntegral fd)) . (pid .~ procId))+  -- | Open a directory, returning its file descriptor. -- Caution - make sure to close the file descriptor! Can use 'closeDirFd'.