File Coverage

blib/lib/IO/Iron/IronCache/Api.pm
Criterion Covered Total %
statement 8 16 50.0
branch n/a
condition n/a
subroutine 5 13 38.4
pod 8 8 100.0
total 21 37 56.7


line stmt bran cond sub pod time code
1             package IO::Iron::IronCache::Api;
2              
3             ## no critic (Documentation::RequirePodAtEnd)
4             ## no critic (Documentation::RequirePodSections)
5              
6 6     6   103 use 5.010_000;
  6         21  
7 6     6   73 use strict;
  6         13  
  6         126  
8 6     6   35 use warnings;
  6         9  
  6         137  
9              
10             # Global Creator
11       6     BEGIN {
12             }
13              
14             # Global Destructor
15       6     END {
16             }
17              
18              
19             # ABSTRACT: IronCache API reference for Perl Client Libraries!
20              
21             our $VERSION = '0.13'; # VERSION: generated by DZP::OurPkgVersion
22              
23              
24              
25              
26              
27             sub IRONCACHE_LIST_CACHES {
28             return {
29 0     0 1   'action_name' => 'IRONCACHE_LIST_CACHES',
30             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches',
31             'action' => 'GET',
32             'return' => 'LIST',
33             'retry' => 0,
34             'require_body' => 0,
35             'paged' => 1,
36             'per_page' => 100,
37             'url_escape' => { '{Project ID}' => 1 },
38             'log_message' => '(project={Project ID}). Listed caches.',
39             };
40             }
41              
42              
43             sub IRONCACHE_GET_INFO_ABOUT_A_CACHE {
44             return {
45 0     0 1   'action_name' => 'IRONCACHE_GET_INFO_ABOUT_A_CACHE',
46             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}',
47             'action' => 'GET',
48             'return' => 'HASH',
49             'retry' => 1,
50             'require_body' => 0,
51             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
52             'log_message' => '(project={Project ID}, cache={Cache Name}). Got info about a cache.',
53             };
54             }
55              
56              
57             sub IRONCACHE_DELETE_A_CACHE {
58             return {
59 0     0 1   'action_name' => 'IRONCACHE_DELETE_A_CACHE',
60             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}',
61             'action' => 'DELETE',
62             'return' => 'MESSAGE',
63             'retry' => 1,
64             'require_body' => 0,
65             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
66             'log_message' => '(project={Project ID}, cache={Cache Name}). Deleted cache.',
67             };
68             }
69              
70              
71             sub IRONCACHE_CLEAR_A_CACHE {
72             return {
73 0     0 1   'action_name' => 'IRONCACHE_CLEAR_A_CACHE',
74             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/clear',
75             'action' => 'POST',
76             'return' => 'MESSAGE',
77             'retry' => 0,
78             'require_body' => 0,
79             'paged' => 0,
80             'per_page' => 0,
81             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
82             'log_message' => '(project={Project ID}, cache={Cache Name}). Cleared cache.',
83             };
84             }
85              
86              
87             sub IRONCACHE_PUT_AN_ITEM_INTO_A_CACHE {
88             return {
89 0     0 1   'action_name' => 'IRONCACHE_PUT_AN_ITEM_INTO_A_CACHE',
90             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
91             'action' => 'PUT',
92             'return' => 'MESSAGE',
93             'retry' => 0,
94             'require_body' => 1,
95             'paged' => 0,
96             'per_page' => 0,
97             'request_fields' => {'value' => '{Value}', 'expires_in' => '{Expires In}', 'replace' => '{Replace}', 'add' => '{Put}', 'cas' => '{Cas}'},
98             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
99             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Put item into cache. Value: \'{Value}\', Expires in: \'{Expires In}\', Replace: \'{Replace}\', Put: \'{Put}\', Cas: \'{Cas}\'.',
100             };
101             }
102              
103              
104             sub IRONCACHE_INCREMENT_AN_ITEMS_VALUE {
105             return {
106 0     0 1   'action_name' => 'IRONCACHE_INCREMENT_AN_ITEMS_VALUE',
107             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}/increment',
108             'action' => 'POST',
109             'return' => 'HASH',
110             'retry' => 0,
111             'require_body' => 1,
112             'paged' => 0,
113             'per_page' => 0,
114             'request_fields' => {'amount' => '{Amount}'},
115             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
116             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Incremented items value by \'{Amount}\'.',
117             };
118             }
119              
120              
121             sub IRONCACHE_GET_AN_ITEM_FROM_A_CACHE {
122             return {
123 0     0 1   'action_name' => 'IRONCACHE_GET_AN_ITEM_FROM_A_CACHE',
124             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
125             'action' => 'GET',
126             'return' => 'HASH',
127             'retry' => 0,
128             'require_body' => 0,
129             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
130             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Got item from cache.',
131             };
132             }
133              
134              
135             sub IRONCACHE_DELETE_AN_ITEM_FROM_A_CACHE {
136             return {
137 0     0 1   'action_name' => 'IRONCACHE_DELETE_AN_ITEM_FROM_A_CACHE',
138             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
139             'action' => 'DELETE',
140             'return' => 'MESSAGE',
141             'retry' => 0,
142             'require_body' => 0,
143             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
144             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Deleted item from cache.',
145             };
146             }
147              
148             1;
149              
150             __END__