improving documentation
This commit is contained in:
@@ -16,7 +16,7 @@ import Error
|
||||
|
||||
import JSON
|
||||
( IPAdressTable
|
||||
, MapPortResponse
|
||||
, MapPortResponse(..)
|
||||
, P2prcConfig
|
||||
)
|
||||
|
||||
@@ -47,19 +47,11 @@ data P2PRCapi = MkP2PRCapi
|
||||
}
|
||||
|
||||
|
||||
{- |
|
||||
|
||||
__Example:__
|
||||
|
||||
@
|
||||
port = 'MkMapPortRequest' 8080 \"jose.akilan.io\"
|
||||
@
|
||||
|
||||
-}
|
||||
-- | This type defines the request required to create an association between a TCP socket port and a DNS server in the network. If successful, it makes a resource available in the network.
|
||||
data MapPortRequest =
|
||||
MkMapPortRequest
|
||||
Int -- ^ TCP socket number
|
||||
String -- ^ Network domain name
|
||||
MkMapPortRequest -- ^ P2PRC's port allocation request value
|
||||
Int -- ^ TCP socket number
|
||||
String -- ^ Network domain name
|
||||
|
||||
|
||||
{-|
|
||||
|
||||
@@ -17,7 +17,7 @@ import System.Process ( terminateProcess )
|
||||
|
||||
import API
|
||||
( P2PRCapi(..)
|
||||
, MapPortRequest(MkMapPortRequest)
|
||||
, MapPortRequest(..)
|
||||
, getP2prcAPI
|
||||
)
|
||||
|
||||
|
||||
@@ -15,16 +15,13 @@ import qualified Data.Text as T
|
||||
import Data.Aeson
|
||||
|
||||
|
||||
{-# WARNING MapPortResponse "This newtype is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-}
|
||||
-- {-# WARNING MapPortResponse "This newtype is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-}
|
||||
|
||||
-- | This record type represents P2PRC's response to the TCP port and DNS address allocation.
|
||||
data MapPortResponse
|
||||
= MkMapPortResponse -- ^ Single data constructor
|
||||
{ ipAddress :: String -- ^ Column separated Host's IP address and Port
|
||||
}
|
||||
-- ^ This newtype represents P2PRC's response to the TCP port and DNS address allocation. This value will confirm the successful allocation and return information about it.
|
||||
newtype MapPortResponse
|
||||
= MkMapPortResponse -- ^ Allocation information value
|
||||
String -- ^ Column separated Host's IP address and Port String
|
||||
deriving Show
|
||||
-- , ipAddress :: IPAddress -- TODO: fix the api output
|
||||
-- , port :: Int -- TODO: fix the api output
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ module P2PRC
|
||||
-- | These types represent the core data that is communicated between requests and the runtime.
|
||||
, IPAdressTable
|
||||
, MapPortRequest(..)
|
||||
, MapPortResponse
|
||||
, MapPortResponse(..)
|
||||
, Error(..)
|
||||
|
||||
-- ** Type Synonyms
|
||||
|
||||
Reference in New Issue
Block a user