-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from well-typed/edsko/cleanup-api
Cleanup API modules
- Loading branch information
Showing
48 changed files
with
223 additions
and
157 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
module Demo.Client.API.StreamType.IO.Ping (ping) where | ||
|
||
import Data.ByteString.Lazy.Char8 qualified as Lazy | ||
|
||
import Network.GRPC.Client | ||
import Network.GRPC.Client.StreamType.IO | ||
import Network.GRPC.Common.Protobuf | ||
|
||
import Demo.Common.API | ||
import Proto.API.Ping | ||
|
||
ping :: Connection -> Lazy.ByteString -> IO () | ||
ping :: Connection -> Proto PingMessage -> IO () | ||
ping conn msg = do | ||
pong <- nonStreaming conn (rpc @Ping) msg | ||
Lazy.putStrLn pong | ||
print pong |
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
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
2 changes: 1 addition & 1 deletion
2
demo-common/Demo/Common/Logging.hs → demo-client/Demo/Client/Util/Logging.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Demo.Common.Logging ( | ||
module Demo.Client.Util.Logging ( | ||
threadSafeTracer | ||
, logMsg | ||
) where | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
module Demo.Server.Service.Ping (handlers) where | ||
{-# LANGUAGE OverloadedLabels #-} | ||
|
||
import Data.ByteString.Lazy qualified as Lazy (ByteString) | ||
module Demo.Server.Service.Ping (handlers) where | ||
|
||
import Network.GRPC.Common.Protobuf | ||
import Network.GRPC.Server.StreamType | ||
|
||
import Demo.Common.API | ||
import Proto.API.Ping | ||
|
||
handlers :: Methods IO '[Ping] | ||
handlers = | ||
Method (mkNonStreaming handlePing) | ||
$ NoMoreMethods | ||
|
||
handlePing :: Lazy.ByteString -> IO Lazy.ByteString | ||
handlePing = return | ||
handlePing :: Proto PingMessage -> IO (Proto PongMessage) | ||
handlePing ping = return $ defMessage & #id .~ (ping ^. #id) | ||
|
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
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
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
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
Oops, something went wrong.