module Network.Ipfs.Api.Pubsub where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Servant.API.ContentTypes (NoContent)
import Network.Ipfs.Api.Internal (_pubsubLs, _pubsubPeers,
_pubsubPublish)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (PubsubObj)
import Network.Ipfs.Client (IpfsT)
ls :: MonadIO m => IpfsT m PubsubObj
ls :: IpfsT m PubsubObj
ls = ClientM PubsubObj -> IpfsT m PubsubObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM PubsubObj
_pubsubLs
peers :: MonadIO m => IpfsT m PubsubObj
peers :: IpfsT m PubsubObj
peers = ClientM PubsubObj -> IpfsT m PubsubObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM PubsubObj
_pubsubPeers
publish :: MonadIO m => Text -> Text -> IpfsT m NoContent
publish :: Text -> Text -> IpfsT m NoContent
publish Text
topic = ClientM NoContent -> IpfsT m NoContent
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM NoContent -> IpfsT m NoContent)
-> (Text -> ClientM NoContent) -> Text -> IpfsT m NoContent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text -> ClientM NoContent
_pubsubPublish Text
topic (Maybe Text -> ClientM NoContent)
-> (Text -> Maybe Text) -> Text -> ClientM NoContent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just