acrostic
A pure Gleam implementation of Google Protobuf.
Note:
only support proto3
only support enum, message, repeated
each message must have an annotation before it start
// @gleam recordis mean a embedded struct (record)// @gleam msgid = 1is mean a api, msgid is a big-end 2 bytes number (max is 65535)when you generated the
game.gleam, thegame.encode(msg)orgame.decode(binary)all Assuming that the msgid is packaged in the head of binary (This will help with communication between the client and server)see
game.proto
gleam add acrostic
import acrostic
pub fn main() {
acrostic.gen(["game.proto"], to: "src/game.gleam", flags: acrostic.Flags(False, False))
}
Further documentation can be found at https://hexdocs.pm/acrostic.
Development
gleam run # Run the project
gleam test # Run the tests