This is a Julia package that provides a compiler and a codec for Protocol Buffers.
Protocol Buffers are a language-neutral, platform-neutral extensible mechanism for serializing structured data.
Given a test.proto file in your current working directory:
syntax = "proto3";
message MyMessage {
sint32 a = 1;
repeated string b = 2;
}
You can generate Julia bindings with the protojl function:
using ProtoBuf
protojl("test.proto", ".", "output_dir")
This will create a Julia file at output_dir/test_pb.jl which you can simply include and start using it to encode and decode messages:
include("output_dir/test_pb.jl")
# Main.test_pb
io = IOBuffer();
e = ProtoEncoder(io);
encode(e, test_pb.MyMessage(-1, ["a", "b"]))
# 8
seekstart(io);
d = ProtoDecoder(io);
decode(d, test_pb.MyMessage)
# Main.test_pb.MyMessage(-1, ["a", "b"])
We'd like to thank the authors of the following packages, as we took inspiration from their projects:
ProtoBuf.jl as a giant shoulder to stand on:).(top 30 of 38)
Julia
100.0%
This is a Julia package that provides a compiler and a codec for Protocol Buffers.
Protocol Buffers are a language-neutral, platform-neutral extensible mechanism for serializing structured data.
Given a test.proto file in your current working directory:
syntax = "proto3";
message MyMessage {
sint32 a = 1;
repeated string b = 2;
}
You can generate Julia bindings with the protojl function:
using ProtoBuf
protojl("test.proto", ".", "output_dir")
This will create a Julia file at output_dir/test_pb.jl which you can simply include and start using it to encode and decode messages:
include("output_dir/test_pb.jl")
# Main.test_pb
io = IOBuffer();
e = ProtoEncoder(io);
encode(e, test_pb.MyMessage(-1, ["a", "b"]))
# 8
seekstart(io);
d = ProtoDecoder(io);
decode(d, test_pb.MyMessage)
# Main.test_pb.MyMessage(-1, ["a", "b"])
We'd like to thank the authors of the following packages, as we took inspiration from their projects:
ProtoBuf.jl as a giant shoulder to stand on:).(top 30 of 38)
Julia
100.0%