syncthing-hs- Haskell bindings for the Syncthing REST API

Copyright(c) 2014 Jens Thomas
Safe HaskellNone
  • OverloadedStrings
  • TupleSections




Syncthing POST requests.


System services

config :: MonadSync m => Config -> SyncM m () Source

Update the server configuration. The configuration will be saved to disk and the configInSync flag set to false. restart Syncthing to activate.

discovery :: MonadSync m => Device -> Server -> SyncM m () Source

Add an entry to the discovery cache.

ping :: MonadSync m => SyncM m Text Source

Ping the Syncthing server. Returns the string "pong".

sendError :: MonadSync m => Text -> SyncM m () Source

Register a new error message.

clearErrors :: MonadSync m => SyncM m () Source

Remove all recent errors.

reset :: MonadSync m => SyncM m SystemMsg Source

Reset Syncthing by renaming all folder directories to temporary, unique names, wiping all indexes and restarting.

restart :: MonadSync m => SyncM m SystemMsg Source

Restart Syncthing.

shutdown :: MonadSync m => SyncM m SystemMsg Source

Shutdown Syncthing.

upgrade :: MonadSync m => SyncM m (Maybe SystemMsg) Source

Perform an upgrade to the newest release and restart. Does nothing if there is no newer version.

Database Services

ignores :: MonadSync m => FolderName -> [Text] -> SyncM m (Maybe [Text]) Source

Update the ignores list and echo it back as response.

prio :: MonadSync m => FolderName -> Path -> SyncM m Need Source

Move the given file to the top of the download queue.

scan :: MonadSync m => FolderName -> Maybe Path -> Maybe Int -> SyncM m () Source

Request rescan of a folder. Restrict the scan to a relative subpath within the folder by specifying the optional path parameter. The optional int argument delays Syncthing's automated rescan interval for a given amount of seconds.