packages feed

ngx-export-tools 1.2.1 → 1.2.2

raw patch · 7 files changed

+77/−13 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ NgxExport.Tools.SimpleService: type NgxExportService = Bool -> IO ByteString
+ NgxExport.Tools.SplitService: type NgxExportService = Bool -> IO ByteString
+ NgxExport.Tools.Types: type NgxExportService = Bool -> IO ByteString

Files

Changelog.md view
@@ -1,3 +1,8 @@+### 1.2.2++- Added a new module *NgxExport.Tools.Types* which exports a new type+  *NgxExportService* for writing a fancier declarations of services.+ ### 1.2.1  - Added function *voidHandler'* in module *NgxExport.Tools.Combinators*.
NgxExport/Tools.hs view
@@ -15,21 +15,28 @@   module NgxExport.Tools (-    -- | === Combinators of effectful actions (including split services)+    -- * Contents+    -- *** Combinators of effectful actions (including split services)                         module NgxExport.Tools.Combinators-    -- | === Reading custom types from /ByteStrings/+    -- *** Reading custom types from /ByteStrings/                        ,module NgxExport.Tools.Read-    -- | === Exporters of simple services+    -- *** Exporters of simple services                        ,module NgxExport.Tools.SimpleService-    -- | === Various functions to access low-level Nginx API+    -- *** Split services+                       ,module NgxExport.Tools.SplitService+    -- *** Various functions to access low-level Nginx API                        ,module NgxExport.Tools.System-    -- | === A simple implementation of time intervals+    -- *** A simple implementation of time intervals                        ,module NgxExport.Tools.TimeInterval+    -- *** Various type declarations+                       ,module NgxExport.Tools.Types                        ) where  import           NgxExport.Tools.Combinators import           NgxExport.Tools.Read import           NgxExport.Tools.SimpleService+import           NgxExport.Tools.SplitService import           NgxExport.Tools.System import           NgxExport.Tools.TimeInterval+import           NgxExport.Tools.Types 
NgxExport/Tools/Combinators.hs view
@@ -36,14 +36,14 @@ -- This function saves printing the final @return L.empty@ action in handlers -- that return unused or empty 'L.ByteString'. ----- For example, handler /signalUpconf/ being declared as an+-- For example, service /signalUpconf/ being used as an -- [/update callback/](https://github.com/lyokha/nginx-haskell-module#update-callbacks) -- in -- -- @ -- type Upconf = [Text] ----- signalUpconf :: Upconf -> Bool -> IO L.ByteString+-- signalUpconf :: Upconf -> t'NgxExport.Tools.Types.NgxExportService' -- signalUpconf upconf = const $ do --     mapConcurrently_ getUrl upconf --     return L.empty@@ -56,7 +56,7 @@ -- it can be rewritten as -- -- @--- signalUpconf :: Upconf -> Bool -> IO L.ByteString+-- signalUpconf :: Upconf -> t'NgxExport.Tools.Types.NgxExportService' -- signalUpconf = const . __/voidHandler/__ . mapConcurrently_ getUrl -- @ --@@ -80,11 +80,11 @@ -- which marks whether the service is running for the first time. This flag is -- often ignored though, in which case using @voidHandler'@ can simplify code. ----- For instance, handler /signalUpconf/ from the example for 'voidHandler' can+-- For instance, service /signalUpconf/ from the example for 'voidHandler' can -- be further simplified as -- -- @--- signalUpconf :: Upconf -> Bool -> IO L.ByteString+-- signalUpconf :: Upconf -> t'NgxExport.Tools.Types.NgxExportService' -- signalUpconf = __/voidHandler'/__ . mapConcurrently_ getUrl -- @ --
NgxExport/Tools/SimpleService.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  NgxExport.Tools.SimpleService--- Copyright   :  (c) Alexey Radkov 2018-2022+-- Copyright   :  (c) Alexey Radkov 2018-2023 -- License     :  BSD-style -- -- Maintainer  :  alexey.radkov@gmail.com@@ -22,6 +22,8 @@                                      ,ngxExportSimpleService                                      ,ngxExportSimpleServiceTyped                                      ,ngxExportSimpleServiceTypedAsJSON+    -- * Type declarations+                                     ,NgxExportService     -- * Re-exported data constructors from /Foreign.C/     -- | Re-exports are needed by exporters for marshalling in foreign calls.                                      ,Foreign.C.Types.CInt (..)@@ -32,6 +34,7 @@ import           NgxExport.Tools.Read import           NgxExport.Tools.System import           NgxExport.Tools.TimeInterval+import           NgxExport.Tools.Types (NgxExportService)  import           Language.Haskell.TH import           Foreign.C.Types
NgxExport/Tools/SplitService.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  NgxExport.Tools.SplitService--- Copyright   :  (c) Alexey Radkov 2018-2022+-- Copyright   :  (c) Alexey Radkov 2018-2023 -- License     :  BSD-style -- -- Maintainer  :  alexey.radkov@gmail.com@@ -19,7 +19,11 @@                                      splitService                                     ,ignitionService                                     ,deferredService+    -- * Type declarations+                                    ,NgxExportService                                     ) where++import           NgxExport.Tools.Types (NgxExportService)  import qualified Data.ByteString.Lazy as L 
+ NgxExport/Tools/Types.hs view
@@ -0,0 +1,44 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  NgxExport.Tools.Types+-- Copyright   :  (c) Alexey Radkov 2023+-- License     :  BSD-style+--+-- Maintainer  :  alexey.radkov@gmail.com+-- Stability   :  stable+-- Portability :  portable+--+-----------------------------------------------------------------------------+++module NgxExport.Tools.Types (+    -- * Exported types+                              NgxExportService+                             ) where++import qualified Data.ByteString.Lazy as L++-- | Allows writing fancier declarations of services.+--+-- For example, service /signalUpconf/ in+--+-- @+-- type Upconf = [Text]+--+-- signalUpconf :: Upconf -> 'Bool' -> 'IO' 'L.ByteString'+-- signalUpconf = 'NgxExport.Tools.Combinators.voidHandler'' . mapConcurrently_ getUrl+--+-- 'NgxExport.Tools.SimpleService.ngxExportSimpleServiceTyped' \'signalUpconf \'\'Upconf $+--     'NgxExport.Tools.SimpleService.PersistentService' Nothing+-- @+--+-- can be rewritten in a fancier way:+--+-- @+-- signalUpconf :: Upconf -> __/NgxExportService/__+-- signalUpconf = 'NgxExport.Tools.Combinators.voidHandler'' . mapConcurrently_ getUrl+-- @+--+-- @since 1.2.2+type NgxExportService = Bool -> IO L.ByteString+
ngx-export-tools.cabal view
@@ -1,5 +1,5 @@ name:                       ngx-export-tools-version:                    1.2.1+version:                    1.2.2 synopsis:                   Extra tools for Nginx haskell module description:                Extra tools for         <https://github.com/lyokha/nginx-haskell-module Nginx haskell module>.@@ -32,6 +32,7 @@                             NgxExport.Tools.SplitService                             NgxExport.Tools.System                             NgxExport.Tools.TimeInterval+                            NgxExport.Tools.Types    ghc-options:             -Wall