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

Function main

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:663–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663int main(int argc, char* argv[])
664{
665 int ch, n = 1, conn_timeout = 10, rw_timeout = 10, ttl = 10;
666 acl::string addr("127.0.0.1:6379"), cmd;
667 bool cluster_mode = false;
668
669 while ((ch = getopt(argc, argv, "hs:n:C:I:a:t:cM")) > 0)
670 {
671 switch (ch)
672 {
673 case 'h':
674 usage(argv[0]);
675 return 0;
676 case 's':
677 addr = optarg;
678 break;
679 case 'n':
680 n = atoi(optarg);
681 break;
682 case 'C':
683 conn_timeout = atoi(optarg);
684 break;
685 case 'I':
686 rw_timeout = atoi(optarg);
687 break;
688 case 'a':
689 cmd = optarg;
690 break;
691 case 't':
692 ttl = atoi(optarg);
693 break;
694 case 'c':
695 cluster_mode = true;
696 break;
697 case 'M':
698 __check_addr = true;
699 break;
700 default:
701 break;
702 }
703 }
704
705 acl::acl_cpp_init();
706 acl::log::stdout_open(true);
707
708 acl::redis_client_cluster cluster;
709 cluster.set(addr.c_str(), 100, conn_timeout, rw_timeout);
710
711 acl::redis_client client(addr.c_str(), conn_timeout, rw_timeout);
712
713 acl::redis_string redis;
714
715 if (cluster_mode)
716 redis.set_cluster(&cluster);
717 else
718 redis.set_client(&client);
719
720 bool ret;

Callers

nothing calls this directly

Calls 15

acl_cpp_initFunction · 0.85
test_setexFunction · 0.85
test_setnxFunction · 0.85
test_getsetFunction · 0.85
test_strlenFunction · 0.85
test_msetFunction · 0.85
test_mgetFunction · 0.85
test_msetnxFunction · 0.85
test_setrangeFunction · 0.85
test_getrangeFunction · 0.85
test_setbitFunction · 0.85
test_getbitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…