package
Version:
v0.0.0-...-9d95335
Opens a new window with list of versions in this module.
Published: Aug 22, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
README
¶
dsn parser
Parse string in the following format to a structure:
- user:pass@host:port/dbname
- user/pass@host:port/dbname
- user:pass@host/dbname
- user:pass@host
- user@host
Details:
- user is required
- host is required
- pass can be empty
- port can be empty
- dbname can be empty
- user and pass is separated by : or /
- host and port is separated by :
- dbname is at the end after / if it is not empty
Documentation
¶
type Flag struct {
Username, Password, Host string
Port int
Database string
}
Flag is the datasource dsn structure.
ParseFlag parses format like user:pass@host:port/db.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.