...

Text file src/go.mongodb.org/mongo-driver/testdata/connection-string/valid-unix_socket-absolute.json

Documentation: go.mongodb.org/mongo-driver/testdata/connection-string

     1{
     2  "tests": [
     3    {
     4      "description": "Unix domain socket (absolute path with trailing slash)",
     5      "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock/",
     6      "valid": true,
     7      "warning": false,
     8      "hosts": [
     9        {
    10          "type": "unix",
    11          "host": "/tmp/mongodb-27017.sock",
    12          "port": null
    13        }
    14      ],
    15      "auth": null,
    16      "options": null
    17    },
    18    {
    19      "description": "Unix domain socket (absolute path without trailing slash)",
    20      "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock",
    21      "valid": true,
    22      "warning": false,
    23      "hosts": [
    24        {
    25          "type": "unix",
    26          "host": "/tmp/mongodb-27017.sock",
    27          "port": null
    28        }
    29      ],
    30      "auth": null,
    31      "options": null
    32    },
    33    {
    34      "description": "Unix domain socket (absolute path with spaces in path)",
    35      "uri": "mongodb://%2Ftmp%2F %2Fmongodb-27017.sock",
    36      "valid": true,
    37      "warning": false,
    38      "hosts": [
    39        {
    40          "type": "unix",
    41          "host": "/tmp/ /mongodb-27017.sock",
    42          "port": null
    43        }
    44      ],
    45      "auth": null,
    46      "options": null
    47    },
    48    {
    49      "description": "Multiple Unix domain sockets (absolute paths)",
    50      "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock",
    51      "valid": true,
    52      "warning": false,
    53      "hosts": [
    54        {
    55          "type": "unix",
    56          "host": "/tmp/mongodb-27017.sock",
    57          "port": null
    58        },
    59        {
    60          "type": "unix",
    61          "host": "/tmp/mongodb-27018.sock",
    62          "port": null
    63        }
    64      ],
    65      "auth": null,
    66      "options": null
    67    },
    68    {
    69      "description": "Multiple hosts (absolute path and ipv4)",
    70      "uri": "mongodb://127.0.0.1:27017,%2Ftmp%2Fmongodb-27017.sock",
    71      "valid": true,
    72      "warning": false,
    73      "hosts": [
    74        {
    75          "type": "ipv4",
    76          "host": "127.0.0.1",
    77          "port": 27017
    78        },
    79        {
    80          "type": "unix",
    81          "host": "/tmp/mongodb-27017.sock",
    82          "port": null
    83        }
    84      ],
    85      "auth": null,
    86      "options": null
    87    },
    88    {
    89      "description": "Multiple hosts (absolute path and hostname resembling relative path)",
    90      "uri": "mongodb://mongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock",
    91      "valid": true,
    92      "warning": false,
    93      "hosts": [
    94        {
    95          "type": "hostname",
    96          "host": "mongodb-27017.sock",
    97          "port": null
    98        },
    99        {
   100          "type": "unix",
   101          "host": "/tmp/mongodb-27018.sock",
   102          "port": null
   103        }
   104      ],
   105      "auth": null,
   106      "options": null
   107    },
   108    {
   109      "description": "Unix domain socket with auth database (absolute path)",
   110      "uri": "mongodb://alice:foo@%2Ftmp%2Fmongodb-27017.sock/admin",
   111      "valid": true,
   112      "warning": false,
   113      "hosts": [
   114        {
   115          "type": "unix",
   116          "host": "/tmp/mongodb-27017.sock",
   117          "port": null
   118        }
   119      ],
   120      "auth": {
   121        "username": "alice",
   122        "password": "foo",
   123        "db": "admin"
   124      },
   125      "options": null
   126    },
   127    {
   128      "description": "Unix domain socket with path resembling socket file (absolute path with trailing slash)",
   129      "uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/",
   130      "valid": true,
   131      "warning": false,
   132      "hosts": [
   133        {
   134          "type": "unix",
   135          "host": "/tmp/path.to.sock/mongodb-27017.sock",
   136          "port": null
   137        }
   138      ],
   139      "auth": null,
   140      "options": null
   141    },
   142    {
   143      "description": "Unix domain socket with path resembling socket file (absolute path without trailing slash)",
   144      "uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock",
   145      "valid": true,
   146      "warning": false,
   147      "hosts": [
   148        {
   149          "type": "unix",
   150          "host": "/tmp/path.to.sock/mongodb-27017.sock",
   151          "port": null
   152        }
   153      ],
   154      "auth": null,
   155      "options": null
   156    },
   157    {
   158      "description": "Unix domain socket with path resembling socket file and auth (absolute path)",
   159      "uri": "mongodb://bob:bar@%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/admin",
   160      "valid": true,
   161      "warning": false,
   162      "hosts": [
   163        {
   164          "type": "unix",
   165          "host": "/tmp/path.to.sock/mongodb-27017.sock",
   166          "port": null
   167        }
   168      ],
   169      "auth": {
   170        "username": "bob",
   171        "password": "bar",
   172        "db": "admin"
   173      },
   174      "options": null
   175    },
   176    {
   177      "description": "Multiple Unix domain sockets and auth DB (absolute path)",
   178      "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin",
   179      "valid": true,
   180      "warning": false,
   181      "hosts": [
   182        {
   183          "type": "unix",
   184          "host": "/tmp/mongodb-27017.sock",
   185          "port": null
   186        },
   187        {
   188          "type": "unix",
   189          "host": "/tmp/mongodb-27018.sock",
   190          "port": null
   191        }
   192      ],
   193      "auth": {
   194        "username": null,
   195        "password": null,
   196        "db": "admin"
   197      },
   198      "options": null
   199    },
   200    {
   201      "description": "Multiple Unix domain sockets with auth DB (absolute path)",
   202      "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin",
   203      "valid": true,
   204      "warning": false,
   205      "hosts": [
   206        {
   207          "type": "unix",
   208          "host": "/tmp/mongodb-27017.sock",
   209          "port": null
   210        },
   211        {
   212          "type": "unix",
   213          "host": "/tmp/mongodb-27018.sock",
   214          "port": null
   215        }
   216      ],
   217      "auth": {
   218        "username": null,
   219        "password": null,
   220        "db": "admin"
   221      },
   222      "options": null
   223    },
   224    {
   225      "description": "Multiple Unix domain sockets with auth and query string (absolute path)",
   226      "uri": "mongodb://bob:bar@%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin?w=1",
   227      "valid": true,
   228      "warning": false,
   229      "hosts": [
   230        {
   231          "type": "unix",
   232          "host": "/tmp/mongodb-27017.sock",
   233          "port": null
   234        },
   235        {
   236          "type": "unix",
   237          "host": "/tmp/mongodb-27018.sock",
   238          "port": null
   239        }
   240      ],
   241      "auth": {
   242        "username": "bob",
   243        "password": "bar",
   244        "db": "admin"
   245      },
   246      "options": {
   247        "w": 1
   248      }
   249    }
   250  ]
   251}

View as plain text