database

package
v0.0.0-...-1a139e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2015 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package database provides a connection to the database backend of eveauth. 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)

	// LoadAllLootPastes retrieves all loot pastes from the database, returning an error if the query failed
	LoadAllLootPastes() ([]*models.LootPaste, error)

	// SaveLootPaste saves a loot paste to the database, returning the updated model or an error if the query failed
	SaveLootPaste(lootPaste *models.LootPaste) (*models.LootPaste, 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

type Type

type Type int

Type represents the type of database backend to use

const (
	// TypeNone represents a non-persistent database backend, only storing values in memory (not implemented)
	TypeNone Type = iota
	// TypeMySQL represents a persistent MySQL database backend
	TypeMySQL
)

func (Type) String

func (t Type) String() string

String returns a easily readable string representations of the given Type

Directories

Path Synopsis
Package mysql provides the underlying connection used by the Database interface, using a MySQL connection.
Package mysql provides the underlying connection used by the Database interface, using a MySQL connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL