Documentation
¶
Index ¶
Constants ¶
View Source
const ( DriverBigQuery = "bigquery" DriverMySQL = "mysql" DriverPostgres = "postgres" DriverSQLite3 = "sqlite3" SchemePostgres = "postgres" DefaultPortMySQL uint16 = 3306 DefaultPortPostgres uint16 = 5432 )
View Source
const ( SSLModeAllow = "allow" SSLModeDisable = "disable" SSLModePrefer = "prefer" SSLModeRequire = "require" SSLModeVerifyCA = "verify-ca" SSLModeVerifyFull = "verify-full" SSLModeDefault = SSLModeDisable )
Variables ¶
View Source
var ErrSSLModeNotSUpported = errors.New("sslmode not supported")
Functions ¶
func SSLModeParse ¶
func SSLModeParseOrDefault ¶
Types ¶
type DataSource ¶
type DataSource struct {
Driver string `json:"driver"`
DSN string `json:"dsn"`
Hostname string `json:"hostname"` // does not include port
Port uint16 `json:"port"` // 0-65535
User string `json:"user,omitempty"`
Password string `json:"password,omitempty"`
Database string `json:"database,omitempty"`
SSLMode string `json:"sslmode,omitempty"`
}
func (DataSource) Host ¶
func (ds DataSource) Host() string
func (DataSource) HostnameOrDefault ¶ added in v0.46.0
func (ds DataSource) HostnameOrDefault() string
func (DataSource) Name ¶ added in v0.46.0
func (ds DataSource) Name() (string, error)
Name produces a URI DSN connection string
func (DataSource) PortOrDefault ¶
func (ds DataSource) PortOrDefault() uint16
func (DataSource) UserPassword ¶
func (ds DataSource) UserPassword() string
Click to show internal directories.
Click to hide internal directories.