diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-04-01 17:24:06 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-04-01 17:24:06 +0200 |
| commit | a4659c4df26f36f806ad24d7524c264a236d7bbb (patch) | |
| tree | 80ee64c1e5a74a6b4cdf4f1dbb3c30b71c2c4ee9 /lib/Plack/Middleware/Throttle | |
| parent | update tests (diff) | |
| download | plack-middleware-throttle-a4659c4df26f36f806ad24d7524c264a236d7bbb.tar.gz | |
start POD
Diffstat (limited to 'lib/Plack/Middleware/Throttle')
| -rw-r--r-- | lib/Plack/Middleware/Throttle/Daily.pm | 42 | ||||
| -rw-r--r-- | lib/Plack/Middleware/Throttle/Hourly.pm | 41 | ||||
| -rw-r--r-- | lib/Plack/Middleware/Throttle/Interval.pm | 42 | ||||
| -rw-r--r-- | lib/Plack/Middleware/Throttle/Limiter.pm | 22 |
4 files changed, 147 insertions, 0 deletions
diff --git a/lib/Plack/Middleware/Throttle/Daily.pm b/lib/Plack/Middleware/Throttle/Daily.pm index d28d1d7..378ce17 100644 --- a/lib/Plack/Middleware/Throttle/Daily.pm +++ b/lib/Plack/Middleware/Throttle/Daily.pm @@ -15,3 +15,45 @@ sub reset_time { } 1; +__END__ + +=head1 NAME + +Plack::Middleware::Throttle::Daily - A Plack Middleware for rate-limiting incoming HTTP requests. + +=head1 SYNOPSIS + + my $handler = builder { + enable "Throttle::Daily", + max => 2, + backend => Plack::Middleware::Throttle::Backend::Hash->new(); + sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] }; + }; + +=head1 DESCRIPTION + +How many request an host can do in one day. + +=head1 OPTIONS + +=over 4 + +=item B<max> + +How many requets can be done in one day. + +=back + +=head1 AUTHOR + +franck cuny E<lt>franck@lumberjaph.netE<gt> + +=head1 SEE ALSO + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + diff --git a/lib/Plack/Middleware/Throttle/Hourly.pm b/lib/Plack/Middleware/Throttle/Hourly.pm index 818d70b..84b3d6d 100644 --- a/lib/Plack/Middleware/Throttle/Hourly.pm +++ b/lib/Plack/Middleware/Throttle/Hourly.pm @@ -15,3 +15,44 @@ sub reset_time { } 1; +__END__ + +=head1 NAME + +Plack::Middleware::Throttle::Hourly - A Plack Middleware for rate-limiting incoming HTTP requests. + +=head1 SYNOPSIS + + my $handler = builder { + enable "Throttle::Hourly", + max => 2, + backend => Plack::Middleware::Throttle::Backend::Hash->new(); + sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] }; + }; + +=head1 DESCRIPTION + +How many request an host can do in one hour. + +=head1 OPTIONS + +=over 4 + +=item B<max> + +How many requets can be done in one hour. + +=back + +=head1 AUTHOR + +franck cuny E<lt>franck@lumberjaph.netE<gt> + +=head1 SEE ALSO + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/lib/Plack/Middleware/Throttle/Interval.pm b/lib/Plack/Middleware/Throttle/Interval.pm index 3e61220..cd40fde 100644 --- a/lib/Plack/Middleware/Throttle/Interval.pm +++ b/lib/Plack/Middleware/Throttle/Interval.pm @@ -29,3 +29,45 @@ sub reset_time { } 1; +__END__ + +=head1 NAME + +Plack::Middleware::Throttle::Interval - A Plack Middleware for rate-limiting incoming HTTP requests. + +=head1 SYNOPSIS + + my $handler = builder { + enable "Throttle::Interval", + min => 2, + backend => Plack::Middleware::Throttle::Backend::Hash->new(); + sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] }; + }; + +=head1 DESCRIPTION + +How many request an host can do between an interval of time (in seconds). + +=head1 OPTIONS + +=over 4 + +=item B<in> + +How many requets can be done in an interval of time. + +=back + +=head1 AUTHOR + +franck cuny E<lt>franck@lumberjaph.netE<gt> + +=head1 SEE ALSO + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + diff --git a/lib/Plack/Middleware/Throttle/Limiter.pm b/lib/Plack/Middleware/Throttle/Limiter.pm index 4194fe4..4a8cd7f 100644 --- a/lib/Plack/Middleware/Throttle/Limiter.pm +++ b/lib/Plack/Middleware/Throttle/Limiter.pm @@ -36,3 +36,25 @@ sub add_headers { } 1; +__END__ + +=head1 NAME + +Plack::Middleware::Throttle - A Plack Middleware for rate-limiting incoming HTTP requests. + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 AUTHOR + +franck cuny E<lt>franck@lumberjaph.netE<gt> + +=head1 SEE ALSO + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut |
