mysql

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage implements Storage interface for data storage

func New

func New(dsn string) Storage

New returns a Storage with data source name

func (Storage) GetDrawingNeededGames

func (s Storage) GetDrawingNeededGames() ([]models.Game, error)

GetDrawingNeededGames gets all drawing games

func (Storage) GetGames

func (s Storage) GetGames(limit, offset int64) ([]models.Game, error)

GetGames gets games order by game_of desc, limit n, offset n

func (Storage) GetLatestBlock

func (s Storage) GetLatestBlock() (models.Block, error)

GetLatestBlock gets latest models.Block

func (Storage) GetTransactionsByGameOfs

func (s Storage) GetTransactionsByGameOfs(gameOfs ...time.Time) ([]models.Transaction, error)

GetTransactionsByGameOfs gets all transactions, filter by game_of

func (Storage) GetUnconfirmedTransactions

func (s Storage) GetUnconfirmedTransactions(confirmations int64) ([]models.Transaction, error)

GetUnconfirmedTransactions gets all unconfirmed transactions

func (Storage) SaveBlockAndTransactions

func (s Storage) SaveBlockAndTransactions(gameOf time.Time, block models.Block, transactions []models.Transaction, game *models.Game) error

SaveBlockAndTransactions save block and transactions

func (*Storage) SetMaxIdleConns

func (s *Storage) SetMaxIdleConns(n int)

SetMaxIdleConns alias sql.DB.SetMaxIdleConns

func (*Storage) SetMaxOpenConns

func (s *Storage) SetMaxOpenConns(n int)

SetMaxOpenConns alias sql.DB.SetMaxOpenConns

func (Storage) UpdateGameToEndedStatus

func (s Storage) UpdateGameToEndedStatus(game models.Game) error

UpdateGameToEndedStatus updates game status to ended

func (Storage) UpdateTransactionConfirmationByID

func (s Storage) UpdateTransactionConfirmationByID(id int64, confirmations int64) error

UpdateTransactionConfirmationByID update confirmations by transaction id

Jump to

Keyboard shortcuts

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