MEDIUM: lua: Improve/revisit the lua api to manipulate channels
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Aug 2021 14:02:36 +0000 (16:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Aug 2021 06:57:07 +0000 (08:57 +0200)
commit6a79fc16bd6e921a3b18290a90736a956178ee96
treef083258795411efdc922bdbd2a0ab13ff34e0d11
parent9a6ffda7958734f7ae2e2996953151e43b3e1df3
MEDIUM: lua: Improve/revisit the lua api to manipulate channels

First of all, following functions are now considered deprecated:

  * Channel:dup()
  * Channel:get()
  * Channel:getline()
  * Channel:get_in_len()
  * Cahnnel:get_out_len()

It is just informative, there is no warning and functions may still be
used. Howver it is recommended to use new functions. New functions are more
flexible and use a better naming pattern. In addition, the same names will
be used in the http_msg class to manipulate http messages from lua filters.

The new API is:

  * Channel:data()
  * Channel:line()
  * Channel:append()
  * Channel:prepend()
  * Channel:insert()
  * Channel:remove()
  * Channel:set()
  * Channel:input()
  * Channel:output()
  * Channel:send()
  * Channel:forward()
  * Channel:is_resp()
  * Channel:is_full()
  * Channel:may_recv()

The lua documentation was updated accordingly.
doc/lua-api/index.rst
src/hlua.c