-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote: add Types.Handshake, use as a greeting result
- Loading branch information
Showing
3 changed files
with
50 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
hnix-store-remote/src/System/Nix/Store/Remote/Types/Handshake.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module System.Nix.Store.Remote.Types.Handshake | ||
( Handshake(..) | ||
) where | ||
|
||
import Data.Text (Text) | ||
import GHC.Generics (Generic) | ||
import System.Nix.Store.Remote.Types.Logger (Logger) | ||
import System.Nix.Store.Remote.Types.ProtoVersion (ProtoVersion) | ||
import System.Nix.Store.Remote.Types.TrustedFlag (TrustedFlag) | ||
|
||
-- | Data for initial protocol handshake | ||
data Handshake = Handshake | ||
{ handshakeNixVersion :: Maybe Text -- ^ Textual version, since 1.33 | ||
, handshakeTrust :: Maybe TrustedFlag -- ^ Whether remote side trusts us | ||
, handshakeProtoVersion :: ProtoVersion -- ^ Minimum protocol supported by both sides | ||
, handshakeRemoteProtoVersion :: ProtoVersion -- ^ Protocol supported by remote side | ||
, handshakeLogs :: [Logger] -- ^ Logs produced right after greeting exchange | ||
} | ||
deriving (Eq, Generic, Ord, Show) |