refactor
This commit is contained in:
parent
2acde0152a
commit
37373fad38
2 changed files with 30 additions and 32 deletions
32
P2P/Http.hs
32
P2P/Http.hs
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue