You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Igor Galić <i....@brainsware.org> on 2013/12/03 15:00:04 UTC
Re: git commit: TS-2335: adding plugin documentation to the site
----- Original Message -----
> Updated Branches:
> refs/heads/master fc97b3167 -> 19022834c
>
>
> TS-2335: adding plugin documentation to the site
>
>
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/19022834
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/19022834
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/19022834
>
> Branch: refs/heads/master
> Commit: 19022834cd39dac18e12e38e859213db0eacc159
> Parents: fc97b31
> Author: Kit Chan <ki...@apache.org>
> Authored: Thu Nov 28 16:13:55 2013 -0800
> Committer: Kit Chan <ki...@apache.org>
> Committed: Thu Nov 28 16:13:55 2013 -0800
>
> ----------------------------------------------------------------------
> doc/reference/plugins/index.en.rst | 1 +
> doc/reference/plugins/ts_lua.en.rst | 546 +++++++++++++++++++++++++++++++
> 2 files changed, 547 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/19022834/doc/reference/plugins/index.en.rst
> ----------------------------------------------------------------------
> diff --git a/doc/reference/plugins/index.en.rst
> b/doc/reference/plugins/index.en.rst
> index fd2a4dd..875b325 100644
> --- a/doc/reference/plugins/index.en.rst
> +++ b/doc/reference/plugins/index.en.rst
> @@ -72,4 +72,5 @@ directory in the Apache Traffic Server source tree.
> Exmperimental plugins can be
> metafilter.en
> mysql_remap.en
> stale_while_revalidate.en
> + ts_lua.en
>
>
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/19022834/doc/reference/plugins/ts_lua.en.rst
> ----------------------------------------------------------------------
> diff --git a/doc/reference/plugins/ts_lua.en.rst
> b/doc/reference/plugins/ts_lua.en.rst
> new file mode 100644
> index 0000000..a0fc7fc
> --- /dev/null
> +++ b/doc/reference/plugins/ts_lua.en.rst
> @@ -0,0 +1,546 @@
License Header is missing.
> +Name
> +======
> +
> +ts-lua - Embed the Power of Lua into TrafficServer.
> +
> +Status
> +======
> +This module is being tested under our production environment.
> +
> +Version
> +======
> +ts-lua has not been released yet.
> +
> +Synopsis
> +======
this is too short.
> +
this needs
::
> +**test_hdr.lua**
> +
> + function send_response()
> + ts.client_response.header['Rhost'] = ts.ctx['rhost']
> + return 0
> + end
> +
> +
> + function do_remap()
> + local req_host = ts.client_request.header.Host
> +
> + if req_host == nil then
> + return 0
> + end
> +
> + ts.ctx['rhost'] = string.reverse(req_host)
> +
> + ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
> +
> + return 0
> + end
> +
> +
> +
> +**test_transform.lua**
> +
This needs
::
> + function upper_transform(data, eos)
> + if eos == 1 then
> + return string.upper(data)..'S.H.E.\n', eos
> + else
> + return string.upper(data), eos
> + end
> + end
> +
> + function send_response()
> + ts.client_response.header['SHE'] = ts.ctx['tb']['she']
> + return 0
> + end
> +
> +
> + function do_remap()
> + local req_host = ts.client_request.header.Host
> +
> + if req_host == nil then
> + return 0
> + end
> +
> + ts.ctx['tb'] = {}
> + ts.ctx['tb']['she'] = 'wo ai yu ye hua'
> +
> + ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
> + ts.hook(TS_LUA_RESPONSE_TRANSFORM, upper_transform)
> +
> + ts.http.resp_cache_transformed(0)
> + ts.http.resp_cache_untransformed(1)
> + return 0
> + end
> +
> +
> +
> +**test_cache_lookup.lua**
> +
This needs
::
etc.. You get the idea.
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F 4008 F266 55D6 2998 1641
Re: git commit: TS-2335: adding plugin documentation to the site
Posted by Igor Galić <i....@brainsware.org>.
See 7264e9ce3ed58f1a9db96b5f609d3e394b23f08b
----- Original Message -----
>
>
> ----- Original Message -----
> > Updated Branches:
> > refs/heads/master fc97b3167 -> 19022834c
> >
> >
> > TS-2335: adding plugin documentation to the site
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> > Commit:
> > http://git-wip-us.apache.org/repos/asf/trafficserver/commit/19022834
> > Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/19022834
> > Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/19022834
> >
> > Branch: refs/heads/master
> > Commit: 19022834cd39dac18e12e38e859213db0eacc159
> > Parents: fc97b31
> > Author: Kit Chan <ki...@apache.org>
> > Authored: Thu Nov 28 16:13:55 2013 -0800
> > Committer: Kit Chan <ki...@apache.org>
> > Committed: Thu Nov 28 16:13:55 2013 -0800
> >
> > ----------------------------------------------------------------------
> > doc/reference/plugins/index.en.rst | 1 +
> > doc/reference/plugins/ts_lua.en.rst | 546 +++++++++++++++++++++++++++++++
> > 2 files changed, 547 insertions(+)
> > ----------------------------------------------------------------------
> >
> >
> > http://git-wip-us.apache.org/repos/asf/trafficserver/blob/19022834/doc/reference/plugins/index.en.rst
> > ----------------------------------------------------------------------
> > diff --git a/doc/reference/plugins/index.en.rst
> > b/doc/reference/plugins/index.en.rst
> > index fd2a4dd..875b325 100644
> > --- a/doc/reference/plugins/index.en.rst
> > +++ b/doc/reference/plugins/index.en.rst
> > @@ -72,4 +72,5 @@ directory in the Apache Traffic Server source tree.
> > Exmperimental plugins can be
> > metafilter.en
> > mysql_remap.en
> > stale_while_revalidate.en
> > + ts_lua.en
> >
> >
> > http://git-wip-us.apache.org/repos/asf/trafficserver/blob/19022834/doc/reference/plugins/ts_lua.en.rst
> > ----------------------------------------------------------------------
> > diff --git a/doc/reference/plugins/ts_lua.en.rst
> > b/doc/reference/plugins/ts_lua.en.rst
> > new file mode 100644
> > index 0000000..a0fc7fc
> > --- /dev/null
> > +++ b/doc/reference/plugins/ts_lua.en.rst
> > @@ -0,0 +1,546 @@
>
> License Header is missing.
>
> > +Name
> > +======
> > +
> > +ts-lua - Embed the Power of Lua into TrafficServer.
> > +
> > +Status
> > +======
> > +This module is being tested under our production environment.
> > +
> > +Version
> > +======
> > +ts-lua has not been released yet.
> > +
> > +Synopsis
> > +======
> this is too short.
>
> > +
>
> this needs
>
> ::
>
> > +**test_hdr.lua**
> > +
> > + function send_response()
> > + ts.client_response.header['Rhost'] = ts.ctx['rhost']
> > + return 0
> > + end
> > +
> > +
> > + function do_remap()
> > + local req_host = ts.client_request.header.Host
> > +
> > + if req_host == nil then
> > + return 0
> > + end
> > +
> > + ts.ctx['rhost'] = string.reverse(req_host)
> > +
> > + ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
> > +
> > + return 0
> > + end
> > +
> > +
> > +
> > +**test_transform.lua**
> > +
>
> This needs
>
> ::
>
> > + function upper_transform(data, eos)
> > + if eos == 1 then
> > + return string.upper(data)..'S.H.E.\n', eos
> > + else
> > + return string.upper(data), eos
> > + end
> > + end
> > +
> > + function send_response()
> > + ts.client_response.header['SHE'] = ts.ctx['tb']['she']
> > + return 0
> > + end
> > +
> > +
> > + function do_remap()
> > + local req_host = ts.client_request.header.Host
> > +
> > + if req_host == nil then
> > + return 0
> > + end
> > +
> > + ts.ctx['tb'] = {}
> > + ts.ctx['tb']['she'] = 'wo ai yu ye hua'
> > +
> > + ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
> > + ts.hook(TS_LUA_RESPONSE_TRANSFORM, upper_transform)
> > +
> > + ts.http.resp_cache_transformed(0)
> > + ts.http.resp_cache_untransformed(1)
> > + return 0
> > + end
> > +
> > +
> > +
> > +**test_cache_lookup.lua**
> > +
>
> This needs
>
> ::
>
> etc.. You get the idea.
>
> --
> Igor Galić
>
> Tel: +43 (0) 664 886 22 883
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
> GPG: 8716 7A9F 989B ABD5 100F 4008 F266 55D6 2998 1641
>
>
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F 4008 F266 55D6 2998 1641