...

Text file src/go.mongodb.org/mongo-driver/testdata/uri-options/srv-options.json

Documentation: go.mongodb.org/mongo-driver/testdata/uri-options

     1{
     2  "tests": [
     3    {
     4      "description": "SRV URI with custom srvServiceName",
     5      "uri": "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname",
     6      "valid": true,
     7      "warning": false,
     8      "hosts": null,
     9      "auth": null,
    10      "options": {
    11        "srvServiceName": "customname"
    12      }
    13    },
    14    {
    15      "description": "Non-SRV URI with custom srvServiceName",
    16      "uri": "mongodb://example.com/?srvServiceName=customname",
    17      "valid": false,
    18      "warning": false,
    19      "hosts": null,
    20      "auth": null,
    21      "options": {}
    22    },
    23    {
    24      "description": "SRV URI with srvMaxHosts",
    25      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2",
    26      "valid": true,
    27      "warning": false,
    28      "hosts": null,
    29      "auth": null,
    30      "options": {
    31        "srvMaxHosts": 2
    32      }
    33    },
    34    {
    35      "description": "SRV URI with negative integer for srvMaxHosts",
    36      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=-1",
    37      "valid": true,
    38      "warning": true,
    39      "hosts": null,
    40      "auth": null,
    41      "options": {}
    42    },
    43    {
    44      "description": "SRV URI with invalid type for srvMaxHosts",
    45      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=foo",
    46      "valid": true,
    47      "warning": true,
    48      "hosts": null,
    49      "auth": null,
    50      "options": {}
    51    },
    52    {
    53      "description": "Non-SRV URI with srvMaxHosts",
    54      "uri": "mongodb://example.com/?srvMaxHosts=2",
    55      "valid": false,
    56      "warning": false,
    57      "hosts": null,
    58      "auth": null,
    59      "options": {}
    60    },
    61    {
    62      "description": "SRV URI with positive srvMaxHosts and replicaSet",
    63      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&replicaSet=foo",
    64      "valid": false,
    65      "warning": false,
    66      "hosts": null,
    67      "auth": null,
    68      "options": {}
    69    },
    70    {
    71      "description": "SRV URI with positive srvMaxHosts and loadBalanced=true",
    72      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=true",
    73      "valid": false,
    74      "warning": false,
    75      "hosts": null,
    76      "auth": null,
    77      "options": {}
    78    },
    79    {
    80      "description": "SRV URI with positive srvMaxHosts and loadBalanced=false",
    81      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=false",
    82      "valid": true,
    83      "warning": false,
    84      "hosts": null,
    85      "auth": null,
    86      "options": {
    87        "loadBalanced": false,
    88        "srvMaxHosts": 2
    89      }
    90    },
    91    {
    92      "description": "SRV URI with srvMaxHosts=0 and replicaSet",
    93      "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=0&replicaSet=foo",
    94      "valid": true,
    95      "warning": false,
    96      "hosts": null,
    97      "auth": null,
    98      "options": {
    99        "replicaSet": "foo",
   100        "srvMaxHosts": 0
   101      }
   102    },
   103    {
   104      "description": "SRV URI with srvMaxHosts=0 and loadBalanced=true",
   105      "uri": "mongodb+srv://test3.test.build.10gen.cc/?srvMaxHosts=0&loadBalanced=true",
   106      "valid": true,
   107      "warning": false,
   108      "hosts": null,
   109      "auth": null,
   110      "options": {
   111        "loadBalanced": true,
   112        "srvMaxHosts": 0
   113      }
   114    }
   115  ]
   116}

View as plain text