Safe Haskell | None |
---|
- data Client = Client {}
- versionPrefix :: String
- buildUrl :: Client -> String -> String
- data Action
- data Response = Response {
- _resAction :: Action
- _resNode :: Node
- _resPrevNode :: Maybe Node
- data Error = Error
- data Node = Node {
- _nodeKey :: String
- _nodeValue :: Maybe String
- _nodeCreatedIndex :: Int
- _nodeModifiedIndex :: Int
- _nodeNodes :: Maybe [Node]
- type HR = Either Error Response
- httpGET :: String -> IO HR
- httpPOST :: String -> [(String, String)] -> IO HR
- runRequest :: IO HR -> IO HR
- ignoreExceptionWith :: a -> SomeException -> a
- createClient :: [String] -> IO Client
- listKeys :: Client -> String -> IO [Node]
- getKey :: Client -> String -> IO (Maybe Node)
- putKey :: Client -> String -> String -> IO ()
Documentation
The version prefix used in URLs. The current client supports v2.
Each response comes with an action field, which describes what kind of action was performed.
The server responds with this object to all successful requests.
Response | |
|
The server sometimes responds to errors with this error object.
Node | |
|
type HR = Either Error ResponseSource
- --------------------------------------------------------------------------
Low-level HTTP interface
The functions here are used internally when sending requests to etcd. If the server is running, the result is 'Either Error Response'. These functions may throw an exception if the server is unreachable or not responding.
runRequest :: IO HR -> IO HRSource
Run a low-level HTTP request. Catch any exceptions and convert them into a 'Left Error'.
ignoreExceptionWith :: a -> SomeException -> aSource
createClient :: [String] -> IO ClientSource
- --------------------------------------------------------------------------
Public API
Create a new client and initialize it with a list of seed machines. The list must be non-empty.