TL language parser for Elixir Hex.pmTravis


Parser generator based on TL schemas. Library version based on main TL schema (currently 57 layer), also contains service messages and official end-to-end (up to 23 layer).


Installation

  1. Add tl to your list of dependencies in mix.exs:
def deps do
  [{:tl, "~> 57.0"}]
end
  1. Ensure tl is started before your application:
def application do
  [applications: [:tl]]
end

Usage

Encoding:

iex> struct = %TL.MTProto.Ping{ping_id: 1}
iex> packet = TL.Serializer.encode(struct)
<<236, 119, 190, 122, 1, 0, 0, 0, 0, 0, 0, 0>>

Decoding:

iex> packet = <<236, 119, 190, 122, 1, 0, 0, 0, 0, 0, 0, 0>>
iex> TL.Serializer.decode(packet)
{:ok, %TL.MTProto.Ping{ping_id: 1}}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request