[PATCH] add documentation about backend naming for VMOD authors
dridi at varni.sh
Sun Nov 1 19:01:46 CET 2015
> This patch just adds a section to the "Writing a Director" doc about
> backend names, and it turned out to be several paragraphs, maybe too
> long-winded. Suggestions for editing are welcome.
Didn't have time to join the discussion earlier, but your patch looks great!
> Or we could move it out to a more comprehensive doc about namespaces,
> but that will take some work (and I'm not sure what all it would have to
We had sort-of started a discussion on IRC at some point about that,
but there's no way AFAIK to enforce namespaces. This is why in this
doc I suggest to back backends with a VMOD object, in order to get a
vcl_name from the compiler and reuse it.
For instance in vmod-named I name backends "<obj>(<ip>)" like in the
old 4.0 days.
With this snippet:
new mydir = named.director("myhost");
You get "myvcl.mydir(<ip>)" full names (uniqueness on ipv4 and ipv6
addresses). I rely on Varnish for a 1st level of namespace
(myvcl.mydir) and then I have my own 2nd level. I hope that helps
clarify my initial intent suggesting VMOD objects for directors in the
More information about the varnish-dev