diff options
Diffstat (limited to 'lib/Config/HAProxy.pm')
-rw-r--r-- | lib/Config/HAProxy.pm | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/lib/Config/HAProxy.pm b/lib/Config/HAProxy.pm index 35e75b9..f220051 100644 --- a/lib/Config/HAProxy.pm +++ b/lib/Config/HAProxy.pm @@ -18,3 +18,3 @@ use Carp; -our $VERSION = '1.05'; +our $VERSION = '1.08'; @@ -25,2 +25,3 @@ my %sections = ( backend => 1, + resolvers => 1 ); @@ -90,2 +91,12 @@ sub parse { +sub declare_section { + my ($class, $name) = @_; + $sections{$name} = 1; +} + +sub undeclare_section { + my ($class, $name) = @_; + $sections{$name} = 0; +} + sub reset { @@ -346,3 +357,5 @@ A container, representing a C<compound statement>, i.e. a statement that contains multiple sub-statements. Compound statements are: B<global>, -B<defaults>, B<frontend>, and B<backend>. +B<defaults>, B<frontend>, B<backend>, and B<resolvers>. The list of +compound statements may be modified using the B<declare_section> and +B<undeclare_section> class methods (see below). @@ -371,3 +384,13 @@ For a detailed description of the node class and its methods, please refer to B<Config::HAProxy::Node>. - + +=head1 CLASS METHODS + + $cfg = Config::HAProxy::declare_section($name) + +Declares B<$name> as a top-level section. + + $cfg = Config::HAProxy::undeclare_section($name) + +Cancels declaration of B<$name> as a top-level section. + =head1 CONSTRUCTOR |