1{-# LANGUAGE DerivingVia, DeriveGeneric, OverloadedStrings #-}
3import Network.RPC.Curryer.Client
4import Network.RPC.Curryer.Server (localHostAddr)
8data SetKey = SetKey String String
9 deriving (Generic, Show)
10 deriving Serialise via WineryVariant SetKey
12data GetKey = GetKey String
13 deriving (Generic, Show)
14 deriving Serialise via WineryVariant GetKey
16data CommandOptions = Get {name :: String}
17 | Set {name :: String, value :: String}
18 deriving (Generic, Show)
20instance ParseRecord CommandOptions
24 opts <- getRecord "SimpleKeyValueClient"
25 -- connect to the remote server (in this case on the localhost address)
26 conn <- connect [] localHostAddr 8765
29 --call the remote function and validate the result
30 eRet <- call conn (GetKey k)
32 Left err -> error (show err)
33 Right (Just val) -> putStrLn val
34 Right Nothing -> error "no such key"
36 eRet <- call conn (SetKey k v)
38 Left err -> error (show err)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list