Documentation
¶
Overview ¶
Package database provides a connection to the database backend of eveslackkills. While presenting a high-level interface to the rest of the application, the package can use underlying connections to different database systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { // Connect tries to establish a connection to the database backend, returning an error if the attempt failed Connect() error // RawQuery performs a raw database query and returns a map of interfaces containing the retrieve data. An error is returned if the query failed RawQuery(query string, v ...interface{}) ([]map[string]interface{}, error) // LoadAllCorporations retrieves all corporations from the database, returning an error if the query failed LoadAllCorporations() ([]*models.Corporation, error) // LoadCorporation retrieves the corporation with the given ID from the database, returning an error if the query failed LoadCorporation(corporationID int64) (*models.Corporation, error) // LoadAllIgnoredSolarSystemsForCorporation retrieves all ignored solar systems associated with the given corporation from the database, returning an error if the query failed LoadAllIgnoredSolarSystemsForCorporation(corporationID int64) ([]int64, error) // SaveCorporation saves a corporation to the database, returning the updated model or an error if the query failed SaveCorporation(corporation *models.Corporation) (*models.Corporation, error) }
Connection provides an interface for communicating with a database backend in order to retrieve and persist the needed information
func SetupDatabase ¶
func SetupDatabase(conf *misc.Configuration) (Connection, error)
SetupDatabase parses the database type set in the configuration and returns an appropriate database implementation or an error if the type is unknown
Click to show internal directories.
Click to hide internal directories.