Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPkg package error. ErrPkg = errors.New("dsn") // ErrInvalidDSN error. ErrInvalidDSN = fmt.Errorf("%w: invalid DSN", ErrPkg) // ErrInvalidQuery error. ErrInvalidQuery = fmt.Errorf("%w: invalid query", ErrPkg) // ErrInvalidPort error. ErrInvalidPort = fmt.Errorf("%w: invalid port", ErrPkg) )
Functions ¶
This section is empty.
Types ¶
type DSN ¶
type DSN struct {
Scheme string
User string
Password string
Host string // first host, for convenience
Port int // first port, for convenience
Hosts []string // all hosts, including the first
Ports []int // all ports, including the first
Path string
Query url.Values
Raw *url.URL
}
DSN represents a parsed data source name, supporting URL-based formats (e.g., mysql://, mongodb://, sqlite://) as well as file paths. It provides normalised access to scheme, credentials, host, port, path, query parameters, and optional cache size suffixes.
Click to show internal directories.
Click to hide internal directories.