syncthing-hs: Haskell bindings for the Syncthing REST API

[ bsd3, library, network ] [ Propose Tags ] [ Report a vulnerability ]
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.2.0.0, 0.3.0.0
Change log changelog.md
Dependencies aeson (>=0.7.0.5), base (>=4.5 && <5), bytestring (>=0.9), connection (>=0.2.2), containers (>=0.5.5.1), either (>=4.0), exceptions (>=0.5), http-client (>=0.4.6), http-client-tls (>=0.2.2), lens (>=4.5), regex-posix (>=0.95.2), text (>=1.1.1.0), time, time-locale-compat, transformers (>=0.2.2.1), unordered-containers (>=0.2.3.3), vector (>=0.10.12.3), wreq (>=0.4.0.0) [details]
License BSD-3-Clause
Author Jens Thomas
Maintainer jetho@gmx.de
Category Network
Home page https://github.com/jetho/syncthing-hs
Bug tracker https://github.com/jetho/syncthing-hs/issues
Source repo head: git clone https://github.com/jetho/syncthing-hs
Uploaded by JensThomas at 2015-05-20T00:43:16Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3059 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for syncthing-hs-0.3.0.0

[back to package description]

syncthing-hs

Hackage Build Status

Haskell bindings for the Syncthing REST API.

Tutorial

A short tutorial is available at: [http://jetho.org/posts/2015-03-07-syncthing-hs-tutorial.html](http://jetho.org/posts/2015-03-07-syncthing-hs-tutorial.html)

Installation

cabal update
cabal install syncthing-hs

Usage Example

{-# LANGUAGE OverloadedStrings #-}

import Control.Lens ((&), (.~), (?~))
import Control.Monad (liftM2)
import qualified Network.Wreq as Wreq
import Network.Syncthing
import qualified Network.Syncthing.Get as Get

-- A single Syncthing request.
single = syncthing defaultConfig Get.ping

-- Connection sharing for multiple Syncthing requests.
multiple1 = withManager $ \cfg ->
    syncthing cfg $ do
        p <- Get.ping
        v <- Get.version
        return (p, v)

-- Multiple Syncthing requests with connection sharing and customized configuration.
multiple2 = withManager $ \cfg -> do
    let cfg' = cfg & pServer .~ "192.168.0.10:8080"
                   & pHttps  .~ True
                   & pAuth   ?~ Wreq.basicAuth "user" "pass"
    syncthing cfg' $ liftM2 (,) Get.ping Get.version