...

Text file src/go.mongodb.org/mongo-driver/testdata/connection-string/valid-host_identifiers.yml

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

     1tests:
     2    -
     3        description: "Single IPv4 host without port"
     4        uri: "mongodb://127.0.0.1"
     5        valid: true
     6        warning: false
     7        hosts:
     8            -
     9                type: "ipv4"
    10                host: "127.0.0.1"
    11                port: ~
    12        auth: ~
    13        options: ~
    14    -
    15        description: "Single IPv4 host with port"
    16        uri: "mongodb://127.0.0.1:27018"
    17        valid: true
    18        warning: false
    19        hosts:
    20            -
    21                type: "ipv4"
    22                host: "127.0.0.1"
    23                port: 27018
    24        auth: ~
    25        options: ~
    26    -
    27        description: "Single IP literal host without port"
    28        uri: "mongodb://[::1]"
    29        valid: true
    30        warning: false
    31        hosts:
    32            -
    33                type: "ip_literal"
    34                host: "::1"
    35                port: ~
    36        auth: ~
    37        options: ~
    38    -
    39        description: "Single IP literal host with port"
    40        uri: "mongodb://[::1]:27019"
    41        valid: true
    42        warning: false
    43        hosts:
    44            -
    45                type: "ip_literal"
    46                host: "::1"
    47                port: 27019
    48        auth: ~
    49        options: ~
    50    -
    51        description: "Single hostname without port"
    52        uri: "mongodb://example.com"
    53        valid: true
    54        warning: false
    55        hosts:
    56            -
    57                type: "hostname"
    58                host: "example.com"
    59                port: ~
    60        auth: ~
    61        options: ~
    62    -
    63        description: "Single hostname with port"
    64        uri: "mongodb://example.com:27020"
    65        valid: true
    66        warning: false
    67        hosts:
    68            -
    69                type: "hostname"
    70                host: "example.com"
    71                port: 27020
    72        auth: ~
    73        options: ~
    74    -
    75        description: "Single hostname (resembling IPv4) without port"
    76        uri: "mongodb://256.0.0.1"
    77        valid: true
    78        warning: false
    79        hosts:
    80            -
    81                type: "hostname"
    82                host: "256.0.0.1"
    83                port: ~
    84        auth: ~
    85        options: ~
    86    -
    87        description: "Multiple hosts (mixed formats)"
    88        uri: "mongodb://127.0.0.1,[::1]:27018,example.com:27019"
    89        valid: true
    90        warning: false
    91        hosts:
    92            -
    93                type: "ipv4"
    94                host: "127.0.0.1"
    95                port: ~
    96            -
    97                type: "ip_literal"
    98                host: "::1"
    99                port: 27018
   100            -
   101                type: "hostname"
   102                host: "example.com"
   103                port: 27019
   104        auth: ~
   105        options: ~
   106    -
   107        description: "UTF-8 hosts"
   108        uri: "mongodb://bücher.example.com,umläut.example.com/"
   109        valid: true
   110        warning: false
   111        hosts:
   112            -
   113                type: "hostname"
   114                host: "bücher.example.com"
   115                port: ~
   116            -
   117                type: "hostname"
   118                host: "umläut.example.com"
   119                port: ~
   120        auth: ~
   121        options: ~

View as plain text