dsn

package
v1.2.117 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDriverName

func GetDriverName(dsn string) string

GetDriverName returns the driver name of a given DSN.

func Join

func Join(scheme string, connect string, query url.Values) (dsn string)

Join joins driver name(scheme) and dsn without schema into a single path, separating them with slashes.

func Masking

func Masking(dsn string) string

Masking hiding original username and password with character '*' [user[:password]@][net[(addr)]]/dbname[?param1=value1&paramN=valueN]

func Split

func Split(dsn string) (scheme string, connect string, query url.Values)

Split splits dsn into a driver name(scheme) and left component. If there is no :// in dsn, Split returns an empty driver name and dsn without schema. The returned values have the property that dsn = driver+dsnSchemaOmitted. schema://[user[:password]@][net[(addr)]]/dbname[?param1=value1&paramN=valueN] => [user[:password]@][net[(addr)]]/dbname[?param1=value1&paramN=valueN]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL