-
Notifications
You must be signed in to change notification settings - Fork 4
/
protobuf-simple.cabal
225 lines (215 loc) · 8.66 KB
/
protobuf-simple.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
-- Initial protobuf-simple.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: protobuf-simple
synopsis: Simple Protocol Buffers library (proto2)
version: 0.1.1.1
homepage: https://github.com/sru-systems/protobuf-simple
license: MIT
license-file: LICENSE
copyright: (c) 2015-2016 Martijn Rijkeboer <[email protected]>
author: Martijn Rijkeboer <[email protected]>
maintainer: Martijn Rijkeboer <[email protected]>
category: Data
stability: experimental
tested-with: GHC == 7.10.3
build-type: Simple
cabal-version: >= 1.10
extra-source-files: README.md
, data/*.bin
, data/Types.proto
description:
.
An Haskell implementation of Google's Protocol Buffers version 2 with an
emphasis on simplicity. The implementation consists of a library for
encoding and decoding of data and the `protobuf-simple-protoc` executable
for generating Haskell types from proto files. In fact, the types that are
used in the tests are generated with the following command:
.
> $ protobuf-simple-protoc data/Types.proto
.
In the example below, the `CustomType` is a Haskell type that was generated
with the `protobuf-simple-protoc` executable. The `encCustomType` function
encodes a CustomType into a ByteString. The `decCustomType` function
decodes a ByteString into either a CustomType or an error.
.
> module Codec where
>
> import Data.ByteString.Lazy (ByteString)
> import Data.ProtoBuf (decode, encode)
> import Types.CustomType (CustomType(..))
>
> encCustomType :: CustomType -> ByteString
> encCustomType = encode
>
> decCustomType :: ByteString -> Either String CustomType
> decCustomType = decode
.
The library exposes two modules, "Data.ProtoBuf", which is used for
encoding and decoding and "Data.ProtoBufInt", which is an internal module
that is used by the generated types.
library
hs-source-dirs: src
exposed-modules: Data.ProtoBuf
, Data.ProtoBufInt
other-modules: Data.ProtoBuf.Default
, Data.ProtoBuf.FieldNumber
, Data.ProtoBuf.Mergeable
, Data.ProtoBuf.Required
, Data.ProtoBuf.WireEnum
, Data.ProtoBuf.WireFormat
, Data.ProtoBuf.WireMessage
, Data.ProtoBuf.WireTag
, Data.ProtoBuf.WireType
, Data.ProtoBuf.ZigZag
build-depends: base >= 4 && < 5
, binary >= 0.7
, bytestring >= 0.9
, containers >= 0.4
, data-binary-ieee754 >= 0.4
, mtl >= 2.0
, text >= 0.11
default-language: Haskell2010
ghc-options: -Wall
executable protobuf-simple-protoc
hs-source-dirs: app, src
main-is: Parser.hs
other-modules: Parser.CaseUtils
, Parser.CodeInfo
, Parser.EnumDesc
, Parser.EnumGenerator
, Parser.EnumValueDesc
, Parser.FieldDesc
, Parser.FileDesc
, Parser.FileWriter
, Parser.Generator
, Parser.GeneratorUtils
, Parser.Label
, Parser.MessageDesc
, Parser.MessageGenerator
, Parser.OptimizeMode
, Parser.ProtoParser
, Parser.Type
build-depends: base
, containers
, directory
, filepath
, mtl
, parsec
, split
, text
default-language: Haskell2010
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
test-suite protobuf-simple-test
type: exitcode-stdio-1.0
hs-source-dirs: test, src
main-is: Spec.hs
other-modules: Data.ProtoBuf
, Data.ProtoBuf.Default
, Data.ProtoBuf.FieldNumber
, Data.ProtoBuf.Mergeable
, Data.ProtoBuf.Required
, Data.ProtoBuf.WireEnum
, Data.ProtoBuf.WireFormat
, Data.ProtoBuf.WireMessage
, Data.ProtoBuf.WireTag
, Data.ProtoBuf.WireType
, Data.ProtoBuf.ZigZag
, Data.ProtoBuf.ZigZagSpec
, Data.ProtoBufInt
, Data.ProtoBufSpec
, Parser.CaseUtils
, Parser.EnumDesc
, Parser.EnumValueDesc
, Parser.FieldDesc
, Parser.FileDesc
, Parser.Label
, Parser.MessageDesc
, Parser.OptimizeMode
, Parser.ProtoParser
, Parser.ProtoParserSpec
, Parser.Type
, Types.BoolList
, Types.BoolListPacked
, Types.BoolMsg
, Types.BoolOptMsg
, Types.BytesList
, Types.BytesMsg
, Types.BytesOptMsg
, Types.DoubleList
, Types.DoubleListPacked
, Types.DoubleMsg
, Types.DoubleOptMsg
, Types.Enum
, Types.EnumList
, Types.EnumListPacked
, Types.EnumMsg
, Types.EnumOptMsg
, Types.Fixed32List
, Types.Fixed32ListPacked
, Types.Fixed32Msg
, Types.Fixed32OptMsg
, Types.Fixed64List
, Types.Fixed64ListPacked
, Types.Fixed64Msg
, Types.Fixed64OptMsg
, Types.FloatList
, Types.FloatListPacked
, Types.FloatMsg
, Types.FloatOptMsg
, Types.Int32List
, Types.Int32ListPacked
, Types.Int32Msg
, Types.Int32OptMsg
, Types.Int64List
, Types.Int64ListPacked
, Types.Int64Msg
, Types.Int64OptMsg
, Types.Message
, Types.MessageList
, Types.MessageMsg
, Types.MessageOptMsg
, Types.SFixed32List
, Types.SFixed32ListPacked
, Types.SFixed32Msg
, Types.SFixed32OptMsg
, Types.SFixed64List
, Types.SFixed64ListPacked
, Types.SFixed64Msg
, Types.SFixed64OptMsg
, Types.SInt32List
, Types.SInt32ListPacked
, Types.SInt32Msg
, Types.SInt32OptMsg
, Types.SInt64List
, Types.SInt64ListPacked
, Types.SInt64Msg
, Types.SInt64OptMsg
, Types.StringList
, Types.StringMsg
, Types.StringOptMsg
, Types.UInt32List
, Types.UInt32ListPacked
, Types.UInt32Msg
, Types.UInt32OptMsg
, Types.UInt64List
, Types.UInt64ListPacked
, Types.UInt64Msg
, Types.UInt64OptMsg
build-depends: QuickCheck
, base
, binary
, bytestring
, containers
, data-binary-ieee754
, filepath
, hspec
, parsec
, protobuf-simple
, quickcheck-instances
, split
, text
default-language: Haskell2010
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
source-repository head
type: git
location: https://github.com/sru-systems/protobuf-simple