| 661 | } |
| 662 | |
| 663 | int 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; |
nothing calls this directly
no test coverage detected
searching dependent graphs…