score

package
v0.0.0-...-57333fd Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2014 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func ConnectDB

func ConnectDB(path string) DB

func (*DB) Begin

func (db *DB) Begin() Tx

func (*DB) Exec

func (db *DB) Exec(query string, args ...interface{}) sql.Result

func (*DB) Query

func (db *DB) Query(query string, args ...interface{}) *sql.Rows

func (*DB) ScanQuery

func (db *DB) ScanQuery(dest interface{}, query string, args ...interface{})

type Database

type Database interface {
	Storage
	Initialize(teams []core.Team)
	ReadScores()
	StartRound() int
}

func NewStorage

func NewStorage(dbPath string, task string) Database

type Storage

type Storage interface {
	Scored(team core.Team, change float64) error
	SyncScores()
	TakeSnapshot()
}

type TaskQueries

type TaskQueries struct {
	DB
	// contains filtered or unexported fields
}

func NewTaskQueries

func NewTaskQueries(path string, task string) TaskQueries

func (*TaskQueries) Clear

func (self *TaskQueries) Clear()

func (*TaskQueries) LastSnapshot

func (self *TaskQueries) LastSnapshot() int

func (*TaskQueries) ReadScores

func (self *TaskQueries) ReadScores(snapshot int) map[core.Team]float64

func (*TaskQueries) WriteScores

func (self *TaskQueries) WriteScores(scores map[core.Team]float64, snapshot int)

type Tx

type Tx struct {
	*sql.Tx
}

func (*Tx) Commit

func (tx *Tx) Commit()

func (*Tx) Exec

func (tx *Tx) Exec(query string, args ...interface{}) sql.Result

Jump to

Keyboard shortcuts

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