path: root/lib/Config/HAProxy/
diff options
authorSergey Poznyakoff <>2018-07-08 22:16:49 +0300
committerSergey Poznyakoff <>2018-07-08 22:16:49 +0300
commit69ff9c1766ed89edf0ffdb63bf487396b6bd081b (patch)
treeef644a810f50d81d3b4e47d7cdbf64df976d8be6 /lib/Config/HAProxy/
parent32b6c6394dc6a789826bd51575d9703bb4097f70 (diff)
Add documentationv1.00
Diffstat (limited to 'lib/Config/HAProxy/')
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/Config/HAProxy/ b/lib/Config/HAProxy/
index 6b0208e..6d80dd9 100644
--- a/lib/Config/HAProxy/
+++ b/lib/Config/HAProxy/
@@ -63,6 +63,74 @@ sub next {
+=head1 NAME
+Config::HAProxy::Iterator - Iterate over objects in the parse tree
+=head1 SYNOPSIS
+ $cfg = Config::HAProxy->new->parse;
+ $itr = $cfg->iterator(inorder => 1);
+ while (defined(my $node = $itr->next)) {
+ # Do something with $node
+ }
+The iterator object provides a method for iterating over all nodes in the
+HAProxy parse tree. The object is returned by the B<iterator> method of
+B<Config::HAProxy> and B<Config::HAProxy::Node> objects. The method takes
+as optional argument the keyword specifying the order in which the tree nodes
+should be traversed. This keyword can be one of the following:
+=over 4
+=item B<recursive =E<gt> 0>
+No recursion. The traversal will not descend into section nodes. This is the
+=item B<inorder =E<gt> 1>
+The nodes will be traversed in the inorder manner, i.e. the section node
+will be visited first, and all its sub-nodes after it.
+=item B<postorder =E<gt> 1>
+The nodes will be traversed in the postorder manner, i.e. for each section
+node, its sub-nodes will be visited first, and the node itself afterward.
+Note: This section is informative. You never need to create
+B<Config::HAProxy::Iterator> objects explicitly. Please use the B<iterator>
+method of B<Config::HAProxy> or B<Config::HAProxy::Node> class objects.
+ $itr = new Config::HAProxy::Iterator($node, %rec);
+Returns new iterator object for traversing the tree starting from B<$node>,
+which must be a B<Config::HAProxy::Node> object. Optional B<%rec> is one of
+the keywords discussed above, in section B<DESCRIPTION>.
+=head1 METHODS
+=head2 next
+ $node = $itr->next;
+Returns next node in the traversal sequence. If all nodes were visited, returns
+=head1 SEE ALSO
+B<HAProxy::Config>, B<HAProxy::Config::Node>.

Return to:

Send suggestions and report system problems to the System administrator.