module Network.Ipfs.Api.Swarm where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Network.Ipfs.Api.Internal (_swarmConnect,
_swarmDisconnect,
_swarmFilterAdd,
_swarmFilterRm, _swarmFilters,
_swarmPeers)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (SwarmObj, SwarmPeersObj)
import Network.Ipfs.Client (IpfsT)
swarmPeers :: MonadIO m => IpfsT m SwarmPeersObj
swarmPeers :: IpfsT m SwarmPeersObj
swarmPeers = ClientM SwarmPeersObj -> IpfsT m SwarmPeersObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM SwarmPeersObj
_swarmPeers
connect :: MonadIO m => Text -> IpfsT m SwarmObj
connect :: Text -> IpfsT m SwarmObj
connect = ClientM SwarmObj -> IpfsT m SwarmObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM SwarmObj -> IpfsT m SwarmObj)
-> (Text -> ClientM SwarmObj) -> Text -> IpfsT m SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> ClientM SwarmObj
_swarmConnect (Maybe Text -> ClientM SwarmObj)
-> (Text -> Maybe Text) -> Text -> ClientM SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
disconnect :: MonadIO m => Text -> IpfsT m SwarmObj
disconnect :: Text -> IpfsT m SwarmObj
disconnect = ClientM SwarmObj -> IpfsT m SwarmObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM SwarmObj -> IpfsT m SwarmObj)
-> (Text -> ClientM SwarmObj) -> Text -> IpfsT m SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> ClientM SwarmObj
_swarmDisconnect (Maybe Text -> ClientM SwarmObj)
-> (Text -> Maybe Text) -> Text -> ClientM SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
filters :: MonadIO m => IpfsT m SwarmObj
filters :: IpfsT m SwarmObj
filters = ClientM SwarmObj -> IpfsT m SwarmObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM SwarmObj
_swarmFilters
filterAdd :: MonadIO m => Text -> IpfsT m SwarmObj
filterAdd :: Text -> IpfsT m SwarmObj
filterAdd = ClientM SwarmObj -> IpfsT m SwarmObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM SwarmObj -> IpfsT m SwarmObj)
-> (Text -> ClientM SwarmObj) -> Text -> IpfsT m SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> ClientM SwarmObj
_swarmFilterAdd (Maybe Text -> ClientM SwarmObj)
-> (Text -> Maybe Text) -> Text -> ClientM SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
filterRm :: MonadIO m => Text -> IpfsT m SwarmObj
filterRm :: Text -> IpfsT m SwarmObj
filterRm = ClientM SwarmObj -> IpfsT m SwarmObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM SwarmObj -> IpfsT m SwarmObj)
-> (Text -> ClientM SwarmObj) -> Text -> IpfsT m SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> ClientM SwarmObj
_swarmFilterRm (Maybe Text -> ClientM SwarmObj)
-> (Text -> Maybe Text) -> Text -> ClientM SwarmObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just