mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-09-11 18:05:56 +03:00
remote: add TestStoreConfig
This commit is contained in:
parent
0ab79e5157
commit
ee172f077f
@ -18,6 +18,9 @@ deriving via GenericArbitrary CheckMode
|
||||
deriving via GenericArbitrary SubstituteMode
|
||||
instance Arbitrary SubstituteMode
|
||||
|
||||
deriving via GenericArbitrary TestStoreConfig
|
||||
instance Arbitrary TestStoreConfig
|
||||
|
||||
deriving via GenericArbitrary ProtoVersion
|
||||
instance Arbitrary ProtoVersion
|
||||
|
||||
|
@ -2,15 +2,17 @@
|
||||
module System.Nix.Store.Remote.Types.StoreConfig
|
||||
( PreStoreConfig(..)
|
||||
, StoreConfig(..)
|
||||
, TestStoreConfig(..)
|
||||
, HasStoreSocket(..)
|
||||
) where
|
||||
|
||||
import GHC.Generics (Generic)
|
||||
import Network.Socket (Socket)
|
||||
import System.Nix.StorePath (HasStoreDir(..), StoreDir)
|
||||
import System.Nix.Store.Remote.Types.ProtoVersion (HasProtoVersion(..), ProtoVersion)
|
||||
|
||||
data PreStoreConfig = PreStoreConfig
|
||||
{ preStoreConfig_dir :: StoreDir
|
||||
{ preStoreConfig_dir :: StoreDir
|
||||
, preStoreConfig_socket :: Socket
|
||||
}
|
||||
|
||||
@ -27,9 +29,9 @@ instance HasStoreSocket PreStoreConfig where
|
||||
hasStoreSocket = preStoreConfig_socket
|
||||
|
||||
data StoreConfig = StoreConfig
|
||||
{ storeConfig_dir :: StoreDir
|
||||
{ storeConfig_dir :: StoreDir
|
||||
, storeConfig_protoVersion :: ProtoVersion
|
||||
, storeConfig_socket :: Socket
|
||||
, storeConfig_socket :: Socket
|
||||
}
|
||||
|
||||
instance HasStoreDir StoreDir where
|
||||
@ -43,3 +45,14 @@ instance HasProtoVersion StoreConfig where
|
||||
|
||||
instance HasStoreSocket StoreConfig where
|
||||
hasStoreSocket = storeConfig_socket
|
||||
|
||||
data TestStoreConfig = TestStoreConfig
|
||||
{ testStoreConfig_dir :: StoreDir
|
||||
, testStoreConfig_protoVersion :: ProtoVersion
|
||||
} deriving (Eq, Generic, Ord, Show)
|
||||
|
||||
instance HasProtoVersion TestStoreConfig where
|
||||
hasProtoVersion = testStoreConfig_protoVersion
|
||||
|
||||
instance HasStoreDir TestStoreConfig where
|
||||
hasStoreDir = testStoreConfig_dir
|
||||
|
Loading…
Reference in New Issue
Block a user