db

package
v0.0.0-...-e3e679c Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBPATH string = "../data/db"

Functions

This section is empty.

Types

type Lottery

type Lottery struct {
	ID            int    `json:"id"`
	Expect        string `json:"expect"`
	Red           string `json:"red"`
	Blue          int    `json:"blue"`
	OpenTime      string `json:"opentime"`
	OpenTimestamp string `json:"opentimestamp"`
}

type Sqlite3

type Sqlite3 struct {
	*sql.DB
}

func NewSqlite3

func NewSqlite3(file string) (*Sqlite3, error)

func (*Sqlite3) AddHistory

func (s *Sqlite3) AddHistory(value Lottery) error

func (*Sqlite3) BatchAddHistory

func (s *Sqlite3) BatchAddHistory(list []Lottery) error

func (*Sqlite3) Close

func (s *Sqlite3) Close()

func (*Sqlite3) GetAllHistory

func (s *Sqlite3) GetAllHistory(query map[string]string, limit int) ([]Lottery, error)

func (*Sqlite3) GetBlueList

func (s *Sqlite3) GetBlueList(where string, limit int) ([]int, error)

func (*Sqlite3) GetRedList

func (s *Sqlite3) GetRedList(where string, limit int) ([][]int, error)

func (*Sqlite3) RemoveAllHistory

func (s *Sqlite3) RemoveAllHistory() error

Jump to

Keyboard shortcuts

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