This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1] Add first protocol buffers message and print its serialization t…
…o terminal (#3) * Add protobuf file with very simple message issue #1 * Edit proto-route.cabal and add Setup.hs files issue #1 * Encounter errors with Haskell file generation issue #1 * Attempt to fix .hs file generation errors with stack issue #1 * Resolve error in generating haskell files issue #1 * Create value of generated message and print to console issue #1 * Print serialized representation issue #1 * Encounter errors in ghci representation issue #1 * Resolve errors in ghci representation issue #1 * Refactor files to improve further modularity issue #1 * Modify ChangeLog.md to include links issue #1 * Re-modify ChangeLog.md to include links issue #1
- Loading branch information
Showing
11 changed files
with
68 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Data.ProtoLens.Setup (defaultMainGeneratingProtos) | ||
|
||
main = defaultMainGeneratingProtos "proto" |
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,7 +1,6 @@ | ||
module Main where | ||
|
||
import ProtoRoute (someFunc) | ||
import qualified ProtoRoute | ||
|
||
main :: IO () | ||
main = someFunc | ||
|
||
main = ProtoRoute.main |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto2"; | ||
|
||
message SearchRequest { | ||
required string query = 1; | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
module ProtoExports | ||
( module Proto.Protobuf1 | ||
, module Proto.Protobuf1_Fields | ||
) where | ||
|
||
import Proto.Protobuf1 | ||
import Proto.Protobuf1_Fields |
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,7 +1,22 @@ | ||
module ProtoRoute | ||
( someFunc | ||
( main | ||
) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn ("someFunc" :: String) | ||
import Language.Haskell.Ghcid (execStream, startGhci, stopGhci) | ||
import System.Directory (getCurrentDirectory) | ||
|
||
main :: IO () | ||
main = do | ||
let f = \_ s -> putStrLn s | ||
curDir <- getCurrentDirectory | ||
(g, _) <- startGhci "ghci" (Just curDir) f | ||
let execStatement s = execStream g s f | ||
execStatement "import Data.Text" | ||
execStatement "import Data.ProtoLens.Encoding" | ||
execStatement ":load src/ProtoExports" | ||
execStatement "let sr = SearchRequest {_SearchRequest'query = pack \"test\"\ | ||
\, _SearchRequest'_unknownFields = ([])}" | ||
-- Value of generated msg, and its serialized representation | ||
execStatement "sr" | ||
execStatement "encodeMessage sr" | ||
stopGhci g |
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,4 @@ | ||
resolver: lts-12.6 | ||
|
||
extra-deps: | ||
- base-noprelude-4.10.1.0 |
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,2 @@ | ||
main :: IO () | ||
main = putStrLn "Test suite not yet implemented" |