From 5394e8a657b2d6398d701c74e544ade913536e66 Mon Sep 17 00:00:00 2001 From: xecarlox94 Date: Thu, 21 Nov 2024 21:58:23 +0000 Subject: [PATCH] working on documentation; finished upper structure --- haskell/lib/JSON.hs | 1 + haskell/lib/P2PRC.hs | 35 ++++++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/haskell/lib/JSON.hs b/haskell/lib/JSON.hs index 134fc1e..3463792 100644 --- a/haskell/lib/JSON.hs +++ b/haskell/lib/JSON.hs @@ -39,6 +39,7 @@ instance FromJSON MapPortResponse where +-- | Host P2prc configuration newtype P2prcConfig = MkP2prConfig { machineName :: String -- , iPTable :: String -- File diff --git a/haskell/lib/P2PRC.hs b/haskell/lib/P2PRC.hs index fc5096d..acf9d1c 100644 --- a/haskell/lib/P2PRC.hs +++ b/haskell/lib/P2PRC.hs @@ -5,12 +5,13 @@ Module : P2PRC Copyright : Copyright (C) 2024-2024 Jose Fernandes License : GNU GPL, version 2 or above - Maintainer : Jose Fernandes Stability : beta Portability : portable -This helper module exports the main functions and data type definitions necessary to get started with the P2PRC api. +This library provides an interface to the P2Prc runtime. + +This Module intends to export the main functions and data type definitions necessary to get started with the P2PRC api. A minimal application will require the import of 'runP2PRC' function that accepts a 'MapPortRequest' value that exposes a specific port number and associates it with a domain name in the internet. @@ -23,8 +24,6 @@ This is a small template to get quickly get started with this interface. We assu > , MapPortRequest(MkMapPortRequest) > ) > -> -> > main :: IO () > main = > runP2PRC @@ -35,14 +34,32 @@ This is a small template to get quickly get started with this interface. We assu module P2PRC - ( getP2prcAPI - , runP2PRC - , MapPortRequest(..) + ( + -- * Functions + {- | These are the available functions available to interact with the P2Prc environment, at a lower level of abstraction. + It is intended this way to give freedom to the developer to implement their own orchestration strategies. + -} + runP2PRC + , getP2prcAPI + + -- * Data Types + {- | This section describes and explains the library's type system, more specifically, the interfaces and primitive types. + -} + + -- ** Interface data types + -- | This section gives an overview on the runtime and host machine interfaces. , P2PRCapi - , IPAdressTable - , MapPortResponse , P2prcConfig + + -- ** Primitive data types + -- | These types represent the core data that is communicated between requests and the runtime. + , IPAdressTable + , MapPortRequest(..) + , MapPortResponse , Error + + -- ** Type Synonyms + -- | This section is reserved to some useful type synonyms that add significant ergonomics. , IOEitherError ) where