MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/redis/redis_geo/redis_geo.cpp:223–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223int main(int argc, char* argv[])
224{
225 int ch, n = 1, conn_timeout = 10, rw_timeout = 10;
226 acl::string addr("127.0.0.1:6379"), cmd;
227
228 while ((ch = getopt(argc, argv, "hs:n:C:T:a:")) > 0)
229 {
230 switch (ch)
231 {
232 case 'h':
233 usage(argv[0]);
234 return 0;
235 case 's':
236 addr = optarg;
237 break;
238 case 'n':
239 n = atoi(optarg);
240 break;
241 case 'C':
242 conn_timeout = atoi(optarg);
243 break;
244 case 'T':
245 rw_timeout = atoi(optarg);
246 break;
247 case 'a':
248 cmd = optarg;
249 break;
250 default:
251 break;
252 }
253 }
254
255 acl::acl_cpp_init();
256
257 acl::redis_client_cluster cluster;
258 cluster.set(addr.c_str(), 100, conn_timeout, rw_timeout);
259
260 acl::redis redis;
261 redis.set_cluster(&cluster);
262
263 bool ret;
264
265 if (cmd == "geoadd")
266 ret = test_geoadd(redis, n);
267 else if (cmd == "geohash")
268 ret = test_geohash(redis, n);
269 else if (cmd == "geopos")
270 ret = test_geopos(redis, n);
271 else if (cmd == "geodist")
272 ret = test_geodist(redis, n);
273 else if (cmd == "georadius")
274 ret = test_georadius(redis, n);
275 else if (cmd == "georadiusbymember")
276 ret = test_georadiusbymember(redis, n);
277 else if (cmd == "all")
278 {
279 ret = test_geoadd(redis, n)
280 && test_geohash(redis, n)

Callers

nothing calls this directly

Calls 12

acl_cpp_initFunction · 0.85
test_geoaddFunction · 0.85
test_geohashFunction · 0.85
test_geoposFunction · 0.85
test_geodistFunction · 0.85
test_georadiusFunction · 0.85
test_georadiusbymemberFunction · 0.85
set_clusterMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
setMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…