]> dgit.raspbian.org Git - git-annex.git/commitdiff
refactor
authorJoey Hess <joeyh@joeyh.name>
Tue, 23 Jul 2024 01:19:32 +0000 (21:19 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 23 Jul 2024 01:19:32 +0000 (21:19 -0400)
P2P/Http.hs
P2P/Http/Types.hs

index ce1e1a44b254ece2d7ba26c5a570b1abde7e8df1..d1efce3ed49311f2972f61dd0807daa13e8e41b3 100644 (file)
@@ -960,35 +960,3 @@ clientKeepLocked clientenv (ProtocolVersion ver) lckid su cu bypass auth a = do
                _ :<|> _ :<|> _ :<|>
                _ :<|> _ :<|> _ :<|> _ :<|>
                v3 :<|> v2 :<|> v1 :<|> v0 :<|> _ = client p2pHttpAPI
-
-type PV3 = Capture "v3" V3
-
-type PV2 = Capture "v2" V2
-
-type PV1 = Capture "v1" V1
-
-type PV0 = Capture "v0" V0
-
-type SU = Capture "serveruuid" (B64UUID ServerSide)
-
-type CU req = QueryParam' '[req] "clientuuid" (B64UUID ClientSide)
-
-type BypassUUIDs = QueryParams "bypass" (B64UUID Bypass)
-
-type CaptureKey = Capture "key" B64Key
-
-type KeyParam = QueryParam' '[Required] "key" B64Key
-
-type AssociatedFileParam = QueryParam "associatedfile" B64FilePath
-       
-type OffsetParam = QueryParam "offset" Offset
-
-type DataLengthHeader = Header DataLengthHeader' DataLength
-
-type DataLengthHeaderRequired = Header' '[Required] DataLengthHeader' DataLength
-
-type DataLengthHeader' = "X-git-annex-data-length"
-
-type LockIDParam = QueryParam' '[Required] "lockid" LockID
-
-type AuthHeader = Header "Authorization" Auth
index f5db2089ef1dfca1a0084ed8aba4250e4d4a1e51..6a9b63a0c012eb0888985c7dee0c55c562575245 100644 (file)
@@ -10,6 +10,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE DataKinds #-}
 
 module P2P.Http.Types where
 
@@ -28,6 +29,35 @@ import Data.Aeson hiding (Key)
 import Control.DeepSeq
 import GHC.Generics (Generic)
 
+type SU = Capture "serveruuid" (B64UUID ServerSide)
+
+type CU req = QueryParam' '[req] "clientuuid" (B64UUID ClientSide)
+
+type BypassUUIDs = QueryParams "bypass" (B64UUID Bypass)
+
+type CaptureKey = Capture "key" B64Key
+
+type KeyParam = QueryParam' '[Required] "key" B64Key
+
+type AssociatedFileParam = QueryParam "associatedfile" B64FilePath
+
+type OffsetParam = QueryParam "offset" Offset
+
+type DataLengthHeader = Header DataLengthHeader' DataLength
+
+type DataLengthHeaderRequired = Header' '[Required] DataLengthHeader' DataLength
+
+type DataLengthHeader' = "X-git-annex-data-length"
+
+type LockIDParam = QueryParam' '[Required] "lockid" LockID
+
+type AuthHeader = Header "Authorization" Auth
+
+type PV3 = Capture "v3" V3
+type PV2 = Capture "v2" V2
+type PV1 = Capture "v1" V1
+type PV0 = Capture "v0" V0
+
 data V3 = V3 deriving (Show)
 data V2 = V2 deriving (Show)
 data V1 = V1 deriving (Show)