The syncthing-hs package

[Tags:bsd3, library, test]

see: https://github.com/syncthing/syncthing/wiki/REST-Interface

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


[Skip to Readme]

Properties

Versions 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 BSD3
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 repository head: git clone https://github.com/jetho/syncthing-hs
Uploaded Wed May 20 00:43:16 UTC 2015 by JensThomas
Distributions NixOS:0.3.0.0
Downloads 581 total (10 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for syncthing-hs

Readme for syncthing-hs-0.3.0.0

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

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