summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Core/PeerAddr.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-07 23:10:27 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-07 23:10:27 +0400
commit1ae7d4877a2a30131babbee54bc0c24651eaba90 (patch)
tree1d2b6835d70a546859569933d0a34037b029d7c5 /src/Network/BitTorrent/Core/PeerAddr.hs
parent44fc77ee51b5aef9d43e3d384845d73646ea1d0e (diff)
Move JSON options to separate module
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r--src/Network/BitTorrent/Core/PeerAddr.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs
index 846a14f9..e7a4ea61 100644
--- a/src/Network/BitTorrent/Core/PeerAddr.hs
+++ b/src/Network/BitTorrent/Core/PeerAddr.hs
@@ -41,6 +41,7 @@ import Text.PrettyPrint.Class
41import Text.Read (readMaybe) 41import Text.Read (readMaybe)
42import System.IO.Unsafe 42import System.IO.Unsafe
43 43
44import Data.Torrent.JSON
44import Network.BitTorrent.Core.PeerId 45import Network.BitTorrent.Core.PeerId
45 46
46 47
@@ -68,7 +69,7 @@ data PeerAddr = PeerAddr
68 , peerPort :: {-# UNPACK #-} !PortNumber 69 , peerPort :: {-# UNPACK #-} !PortNumber
69 } deriving (Show, Eq, Ord, Typeable) 70 } deriving (Show, Eq, Ord, Typeable)
70 71
71$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PeerAddr) 72$(deriveJSON omitRecordPrefix ''PeerAddr)
72 73
73peer_id_key, peer_ip_key, peer_port_key :: BKey 74peer_id_key, peer_ip_key, peer_port_key :: BKey
74peer_id_key = "peer id" 75peer_id_key = "peer id"