Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaskPasswordInDSN ¶
MaskPasswordInDSN masks the password within the MySQL data source name dsn. This function is usually used when displaying or logging the DSN.
When password is empty (not provided) the mask is added anyway. When the DSN is something that was not a DSN, the mask itself is returned to prevent possible mistakes.
func ReplaceDSNDatabase ¶
ReplaceDSNDatabase takes dsn and replaces the database name. It returns the new Data Source Name.
Types ¶
type DataSource ¶
type DataSource struct { Driver string User string Password string Protocol string Address string Schema string Options url.Values }
func ParseDSN ¶
func ParseDSN(name string) (*DataSource, error)
ParseDSN parsers the name as a data source name (DSN).
func (*DataSource) Format ¶
func (d *DataSource) Format() string
func (*DataSource) String ¶
func (d *DataSource) String() string
String returns a simplified representation of d. Simplified means that only username, protocol, address, and schema (if available) are included. The password is obfuscated.
Click to show internal directories.
Click to hide internal directories.