| 1 | package TaskPipe::UserAgentManager::CheckIPSettings; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | with 'MooseX::ConfigCascade'; | |
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | TaskPipe::UserAgentManager::CheckIPSettings | ||
| 9 | |||
| 10 | =head1 DESCRIPTION | ||
| 11 | |||
| 12 | Settings for to use to check IP for L<TaskPipe::UserAgentManager> | ||
| 13 | |||
| 14 | =head1 METHODS | ||
| 15 | |||
| 16 | =over | ||
| 17 | |||
| 18 | =item url | ||
| 19 | |||
| 20 | The url to use to return originating IP | ||
| 21 | |||
| 22 | =cut | ||
| 23 | |||
| 24 | 1 | has url => (is => 'ro', isa => 'Str', default => 'http://checkip.dyndns.org'); | |
| 25 | |||
| 26 | =item regex | ||
| 27 | |||
| 28 | The regex to return the IP from the response | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | 1 | has regex => (is => 'ro', isa => 'Str', default => 'Current IP Address:\s*([\d\.]+)'); | |
| 33 | |||
| 34 | |||
| 35 | =item max_retries | ||
| 36 | |||
| 37 | The maximum number of times to retry if the request fails | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | 1 | has max_retries => (is => 'ro', isa => 'Int', default => 4); | |
| 42 | |||
| 43 | |||
| 44 | =item retry_delay | ||
| 45 | |||
| 46 | The number of seconds to wait between retries if the request fails | ||
| 47 | |||
| 48 | =back | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 1 | has retry_delay => (is => 'ro', isa => 'Int', default => 1); | |
| 53 | |||
| 54 | |||
| 55 | =head1 AUTHOR | ||
| 56 | |||
| 57 | Tom Gracey <tomgracey@gmail.com> | ||
| 58 | |||
| 59 | =head1 COPYRIGHT AND LICENSE | ||
| 60 | |||
| 61 | Copyright (c) Tom Gracey 2018 | ||
| 62 | |||
| 63 | TaskPipe is free software, licensed under | ||
| 64 | |||
| 65 | The GNU Public License Version 3 | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | |||
| 70 | 1 | __PACKAGE__->meta->make_immutable; | |
| 71 | 1 | 1; | |
| 72 | __END__ | ||