You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Shu Kit Chan <ch...@gmail.com> on 2019/05/21 06:50:35 UTC

[PROPOSAL] Restructuring the example directory and adding lua scripts to it

Hi,

During the spring summit, we discussed changing the structure example
directory to include some lua scripts as well as other future works

Here is my proposal -

/example/plugins/ - I will move all existing plugin examples underneath here
/example/plugins/lua/ - I will put a few lua scripts as example here
/example/config/ - in future we can put some directories here showing
examples of configuration files (e.g. cache.config, ip_allow.config,
logging.yaml, etc)

Any thoughts?

Thanks.

Kit

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Sudheer Vinukonda <su...@yahoo.com.INVALID>.
 +1

    On Monday, May 20, 2019, 11:50:50 PM PDT, Shu Kit Chan <ch...@gmail.com> wrote:  
 
 Hi,

During the spring summit, we discussed changing the structure example
directory to include some lua scripts as well as other future works

Here is my proposal -

/example/plugins/ - I will move all existing plugin examples underneath here
/example/plugins/lua/ - I will put a few lua scripts as example here
/example/config/ - in future we can put some directories here showing
examples of configuration files (e.g. cache.config, ip_allow.config,
logging.yaml, etc)

Any thoughts?

Thanks.

Kit
  

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Bryan Call <bc...@apache.org>.
+1 - I like it better.

-Bryan


> On May 24, 2019, at 9:42 AM, Shu Kit Chan <ch...@gmail.com> wrote:
> 
> Leif made a suggestion on the PR and suggested the following structure instead
> 
>    example/
>        plugins/
>            c-api/
>                null-transform/
>            cpp-api/
>                ...
>            lua-api/
>                ...
>        configs/
>            forward/
>            reverse/
>            transparent/
> 
> I think it is easier to find the c/c++/lua examples this way as well.
> 
> Any comments?
> 
> Kit
> 
> On Fri, May 24, 2019 at 12:47 AM Shu Kit Chan <ch...@gmail.com> wrote:
>> 
>> Here is the PR for this change.
>> https://github.com/apache/trafficserver/pull/5573
>> 
>> Thanks.
>> 
>> Kit
>> 
>> On Tue, May 21, 2019 at 12:29 PM Steven R. Feltner <sf...@godaddy.com> wrote:
>>> 
>>> +1
>>> 
>>> On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:
>>> 
>>>    Notice: This email is from an external sender.
>>> 
>>> 
>>> 
>>>    Hi,
>>> 
>>>    During the spring summit, we discussed changing the structure example
>>>    directory to include some lua scripts as well as other future works
>>> 
>>>    Here is my proposal -
>>> 
>>>    /example/plugins/ - I will move all existing plugin examples underneath here
>>>    /example/plugins/lua/ - I will put a few lua scripts as example here
>>>    /example/config/ - in future we can put some directories here showing
>>>    examples of configuration files (e.g. cache.config, ip_allow.config,
>>>    logging.yaml, etc)
>>> 
>>>    Any thoughts?
>>> 
>>>    Thanks.
>>> 
>>>    Kit
>>> 
>>> 


Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Shu Kit Chan <ch...@gmail.com>.
Currently, the existing examples may not have all 3 (C, CPP, LUA)
versions available. Often it is just 1.

On other note, for me, it is helpful to see multiple examples in the
same language so I can copy and combine ideas from them when I need to
write a new plugin for new functionality.

Kit

On Fri, May 24, 2019 at 10:13 AM Sudheer Vinukonda
<su...@yahoo.com.invalid> wrote:
>
>  Hmm..I typically use examples to find a relevant sample code for a use case I'm interested in. For example, if I'm looking to write a transform plugin, I'd try and find an existing example for transform. The C/CPP/LUA API is great, of course, but that's usually my second level of search.
> From that perspective, I'm curious to see if it would make sense to consider a "functional" abstraction layer under which, we can add the various API flavors? For example, SSL, Headers, Intercept, Transform etc and then under each of those, you've C, CPP, LUA etc.
> Thoughts?
> Thanks,
> Sudheer
>
>     On Friday, May 24, 2019, 9:42:28 AM PDT, Shu Kit Chan <ch...@gmail.com> wrote:
>
>  Leif made a suggestion on the PR and suggested the following structure instead
>
>     example/
>         plugins/
>             c-api/
>                 null-transform/
>             cpp-api/
>                 ...
>             lua-api/
>                 ...
>         configs/
>             forward/
>             reverse/
>             transparent/
>
> I think it is easier to find the c/c++/lua examples this way as well.
>
> Any comments?
>
> Kit
>
> On Fri, May 24, 2019 at 12:47 AM Shu Kit Chan <ch...@gmail.com> wrote:
> >
> > Here is the PR for this change.
> > https://github.com/apache/trafficserver/pull/5573
> >
> > Thanks.
> >
> > Kit
> >
> > On Tue, May 21, 2019 at 12:29 PM Steven R. Feltner <sf...@godaddy.com> wrote:
> > >
> > > +1
> > >
> > > On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:
> > >
> > >    Notice: This email is from an external sender.
> > >
> > >
> > >
> > >    Hi,
> > >
> > >    During the spring summit, we discussed changing the structure example
> > >    directory to include some lua scripts as well as other future works
> > >
> > >    Here is my proposal -
> > >
> > >    /example/plugins/ - I will move all existing plugin examples underneath here
> > >    /example/plugins/lua/ - I will put a few lua scripts as example here
> > >    /example/config/ - in future we can put some directories here showing
> > >    examples of configuration files (e.g. cache.config, ip_allow.config,
> > >    logging.yaml, etc)
> > >
> > >    Any thoughts?
> > >
> > >    Thanks.
> > >
> > >    Kit
> > >
> > >

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Sudheer Vinukonda <su...@yahoo.com.INVALID>.
 Hmm..I typically use examples to find a relevant sample code for a use case I'm interested in. For example, if I'm looking to write a transform plugin, I'd try and find an existing example for transform. The C/CPP/LUA API is great, of course, but that's usually my second level of search. 
From that perspective, I'm curious to see if it would make sense to consider a "functional" abstraction layer under which, we can add the various API flavors? For example, SSL, Headers, Intercept, Transform etc and then under each of those, you've C, CPP, LUA etc.
Thoughts?
Thanks,
Sudheer

    On Friday, May 24, 2019, 9:42:28 AM PDT, Shu Kit Chan <ch...@gmail.com> wrote:  
 
 Leif made a suggestion on the PR and suggested the following structure instead

    example/
        plugins/
            c-api/
                null-transform/
            cpp-api/
                ...
            lua-api/
                ...
        configs/
            forward/
            reverse/
            transparent/

I think it is easier to find the c/c++/lua examples this way as well.

Any comments?

Kit

On Fri, May 24, 2019 at 12:47 AM Shu Kit Chan <ch...@gmail.com> wrote:
>
> Here is the PR for this change.
> https://github.com/apache/trafficserver/pull/5573
>
> Thanks.
>
> Kit
>
> On Tue, May 21, 2019 at 12:29 PM Steven R. Feltner <sf...@godaddy.com> wrote:
> >
> > +1
> >
> > On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:
> >
> >    Notice: This email is from an external sender.
> >
> >
> >
> >    Hi,
> >
> >    During the spring summit, we discussed changing the structure example
> >    directory to include some lua scripts as well as other future works
> >
> >    Here is my proposal -
> >
> >    /example/plugins/ - I will move all existing plugin examples underneath here
> >    /example/plugins/lua/ - I will put a few lua scripts as example here
> >    /example/config/ - in future we can put some directories here showing
> >    examples of configuration files (e.g. cache.config, ip_allow.config,
> >    logging.yaml, etc)
> >
> >    Any thoughts?
> >
> >    Thanks.
> >
> >    Kit
> >
> >  

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Shu Kit Chan <ch...@gmail.com>.
Leif made a suggestion on the PR and suggested the following structure instead

    example/
        plugins/
            c-api/
                null-transform/
            cpp-api/
                ...
            lua-api/
                ...
        configs/
            forward/
            reverse/
            transparent/

I think it is easier to find the c/c++/lua examples this way as well.

Any comments?

Kit

On Fri, May 24, 2019 at 12:47 AM Shu Kit Chan <ch...@gmail.com> wrote:
>
> Here is the PR for this change.
> https://github.com/apache/trafficserver/pull/5573
>
> Thanks.
>
> Kit
>
> On Tue, May 21, 2019 at 12:29 PM Steven R. Feltner <sf...@godaddy.com> wrote:
> >
> > +1
> >
> > On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:
> >
> >     Notice: This email is from an external sender.
> >
> >
> >
> >     Hi,
> >
> >     During the spring summit, we discussed changing the structure example
> >     directory to include some lua scripts as well as other future works
> >
> >     Here is my proposal -
> >
> >     /example/plugins/ - I will move all existing plugin examples underneath here
> >     /example/plugins/lua/ - I will put a few lua scripts as example here
> >     /example/config/ - in future we can put some directories here showing
> >     examples of configuration files (e.g. cache.config, ip_allow.config,
> >     logging.yaml, etc)
> >
> >     Any thoughts?
> >
> >     Thanks.
> >
> >     Kit
> >
> >

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Shu Kit Chan <ch...@gmail.com>.
Here is the PR for this change.
https://github.com/apache/trafficserver/pull/5573

Thanks.

Kit

On Tue, May 21, 2019 at 12:29 PM Steven R. Feltner <sf...@godaddy.com> wrote:
>
> +1
>
> On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:
>
>     Notice: This email is from an external sender.
>
>
>
>     Hi,
>
>     During the spring summit, we discussed changing the structure example
>     directory to include some lua scripts as well as other future works
>
>     Here is my proposal -
>
>     /example/plugins/ - I will move all existing plugin examples underneath here
>     /example/plugins/lua/ - I will put a few lua scripts as example here
>     /example/config/ - in future we can put some directories here showing
>     examples of configuration files (e.g. cache.config, ip_allow.config,
>     logging.yaml, etc)
>
>     Any thoughts?
>
>     Thanks.
>
>     Kit
>
>

Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by "Steven R. Feltner" <sf...@godaddy.com>.
+1

On 5/21/19, 2:50 AM, "Shu Kit Chan" <ch...@gmail.com> wrote:

    Notice: This email is from an external sender.
    
    
    
    Hi,
    
    During the spring summit, we discussed changing the structure example
    directory to include some lua scripts as well as other future works
    
    Here is my proposal -
    
    /example/plugins/ - I will move all existing plugin examples underneath here
    /example/plugins/lua/ - I will put a few lua scripts as example here
    /example/config/ - in future we can put some directories here showing
    examples of configuration files (e.g. cache.config, ip_allow.config,
    logging.yaml, etc)
    
    Any thoughts?
    
    Thanks.
    
    Kit
    


Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Leif Hedstrom <zw...@apache.org>.

> On May 21, 2019, at 12:50 AM, Shu Kit Chan <ch...@gmail.com> wrote:
> 
> Hi,
> 
> During the spring summit, we discussed changing the structure example
> directory to include some lua scripts as well as other future works
> 
> Here is my proposal -
> 
> /example/plugins/ - I will move all existing plugin examples underneath here
> /example/plugins/lua/ - I will put a few lua scripts as example here
> /example/config/ - in future we can put some directories here showing
> examples of configuration files (e.g. cache.config, ip_allow.config,
> logging.yaml, etc)


Makes sense, +1. Maybe under example/config, we have some structure as well? E.g. (just thinking out loud):

	example/config/forward
	example/config/reverse
	example/config/transparent
	example/config/child-parent

etc. …


Cheers,

— Leif


Re: [PROPOSAL] Restructuring the example directory and adding lua scripts to it

Posted by Bryan Call <bc...@apache.org>.
+1 - Sounds good

-Bryan


> On May 20, 2019, at 11:50 PM, Shu Kit Chan <ch...@gmail.com> wrote:
> 
> Hi,
> 
> During the spring summit, we discussed changing the structure example
> directory to include some lua scripts as well as other future works
> 
> Here is my proposal -
> 
> /example/plugins/ - I will move all existing plugin examples underneath here
> /example/plugins/lua/ - I will put a few lua scripts as example here
> /example/config/ - in future we can put some directories here showing
> examples of configuration files (e.g. cache.config, ip_allow.config,
> logging.yaml, etc)
> 
> Any thoughts?
> 
> Thanks.
> 
> Kit