github.com/bingoohuang/gg@v0.0.0-20240325092523-45da7dee9335/pkg/dsn/README.md (about)

     1  # dsn parser
     2  
     3  Parse string in the following format to a structure:
     4  
     5  1. user:pass@host:port/dbname
     6  1. user/pass@host:port/dbname
     7  1. user:pass@host/dbname
     8  1. user:pass@host
     9  1. user@host
    10  
    11  Details:
    12  
    13  1. user is required
    14  1. host is required
    15  1. pass can be empty
    16  1. port can be empty
    17  1. dbname can be empty
    18  1. user and pass is separated by : or /
    19  1. host and port is separated by :
    20  1. dbname is at the end after / if it is not empty