Documentation ¶
Index ¶
- Constants
- func GetDriverName(driverAliasName string) (string, bool)
- func Register(driverName string, driverAliasName string, dsnAdapter DataSourceNameAdapter)
- type DataSource
- type DataSourceNameAdapter
- type DataSourceOption
- type SimpleDataSource
- func (dataSource *SimpleDataSource) GetConnection() (*sql.DB, error)
- func (dataSource *SimpleDataSource) GetDriverName() string
- func (dataSource *SimpleDataSource) GetPassword() string
- func (dataSource *SimpleDataSource) GetURL() *url.URL
- func (dataSource *SimpleDataSource) GetUsername() string
- func (dataSource *SimpleDataSource) SetPassword(password string)
- func (dataSource *SimpleDataSource) SetUsername(username string)
Constants ¶
View Source
const Scheme = "gdbc"
Variables ¶
This section is empty.
Functions ¶
func GetDriverName ¶ added in v1.0.2
func Register ¶
func Register(driverName string, driverAliasName string, dsnAdapter DataSourceNameAdapter)
Types ¶
type DataSource ¶
type DataSource interface { GetDriverName() string GetURL() *url.URL GetConnection() (*sql.DB, error) GetUsername() string SetUsername(username string) GetPassword() string SetPassword(password string) }
func GetDataSource ¶
func GetDataSource(url string, options ...DataSourceOption) (DataSource, error)
type DataSourceNameAdapter ¶
type DataSourceNameAdapter interface {
GetDataSourceName(dataSource DataSource) (string, error)
}
func GetDataSourceNameAdapter ¶
func GetDataSourceNameAdapter(driverAliasName string) DataSourceNameAdapter
type DataSourceOption ¶
type DataSourceOption func(dataSource DataSource)
func Password ¶
func Password(password string) DataSourceOption
func Username ¶
func Username(username string) DataSourceOption
type SimpleDataSource ¶
type SimpleDataSource struct {
// contains filtered or unexported fields
}
func (*SimpleDataSource) GetConnection ¶
func (dataSource *SimpleDataSource) GetConnection() (*sql.DB, error)
func (*SimpleDataSource) GetDriverName ¶
func (dataSource *SimpleDataSource) GetDriverName() string
func (*SimpleDataSource) GetPassword ¶
func (dataSource *SimpleDataSource) GetPassword() string
func (*SimpleDataSource) GetURL ¶
func (dataSource *SimpleDataSource) GetURL() *url.URL
func (*SimpleDataSource) GetUsername ¶
func (dataSource *SimpleDataSource) GetUsername() string
func (*SimpleDataSource) SetPassword ¶
func (dataSource *SimpleDataSource) SetPassword(password string)
func (*SimpleDataSource) SetUsername ¶
func (dataSource *SimpleDataSource) SetUsername(username string)
Click to show internal directories.
Click to hide internal directories.