Documentation ¶
Overview ¶
Package mysql provides the underlying connection used by the Database interface, using a MySQL connection.
Index ¶
- type DatabaseConnection
- func (c *DatabaseConnection) Connect() error
- func (c *DatabaseConnection) LoadAllLootPastes() ([]*models.LootPaste, error)
- func (c *DatabaseConnection) RawQuery(query string, v ...interface{}) ([]map[string]interface{}, error)
- func (c *DatabaseConnection) SaveLootPaste(lootPaste *models.LootPaste) (*models.LootPaste, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseConnection ¶
type DatabaseConnection struct { // Config stores the current configuration values being used Config *misc.Configuration // contains filtered or unexported fields }
DatabaseConnection provides an implementation of the Connection interface using a MySQL database
func (*DatabaseConnection) Connect ¶
func (c *DatabaseConnection) Connect() error
Connect tries to establish a connection to the MySQL backend, returning an error if the attempt failed
func (*DatabaseConnection) LoadAllLootPastes ¶
func (c *DatabaseConnection) LoadAllLootPastes() ([]*models.LootPaste, error)
LoadAllLootPastes retrieves all loot pastes from the MySQL database, returning an error if the query failed
func (*DatabaseConnection) RawQuery ¶
func (c *DatabaseConnection) RawQuery(query string, v ...interface{}) ([]map[string]interface{}, error)
RawQuery performs a raw MySQL query and returns a map of interfaces containing the retrieve data. An error is returned if the query failed
func (*DatabaseConnection) SaveLootPaste ¶
SaveLootPaste saves a loot paste to the MySQL database, returning the updated model or an error if the query failed