38 lines
724 B
Go
38 lines
724 B
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate wire
|
|
//+build !wireinject
|
|
|
|
package repository
|
|
|
|
import (
|
|
"database/sql"
|
|
"github.com/ollien/updown/config"
|
|
)
|
|
|
|
import (
|
|
_ "github.com/lib/pq"
|
|
)
|
|
|
|
// Injectors from wire_stubs.go:
|
|
|
|
func initDatabaseConnector() (*DatabaseConnector, error) {
|
|
configConfig := config.Get()
|
|
databaseConnector, err := provideDatabaseConnector(configConfig)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return databaseConnector, nil
|
|
}
|
|
|
|
// wire_stubs.go:
|
|
|
|
func provideDatabaseConnector(appConfig config.Config) (*DatabaseConnector, error) {
|
|
connection, err := sql.Open(driver, appConfig.DatabaseURI)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &DatabaseConnector{connection}, connection.Ping()
|
|
}
|