db interface
This commit is contained in:
parent
ab660ca622
commit
5f9180efaf
@ -9,10 +9,7 @@ type Block struct {
|
||||
type DBAccessor interface {
|
||||
IsMigrated() (bool, error)
|
||||
Migrate() error
|
||||
FindLatestBlocks(time int64, limit int) []Block
|
||||
|
||||
//Block range lookup
|
||||
FindBlocks(posx int, posz int, posystart int, posyend int) []Block
|
||||
GetXRange(posystart int, posyend int) (int, int)
|
||||
GetZRange(posystart int, posyend int) (int, int)
|
||||
FindLatestBlocks(mintime int64, limit int) []Block, error
|
||||
FindBlocks(posx int, posz int, posystart int, posyend int) []Block, error
|
||||
CountBlocks(x1, x2, y1, y2, z1, z2 int) int, error
|
||||
}
|
||||
|
16
db/sqlite.go
16
db/sqlite.go
@ -11,22 +11,18 @@ func (db *Sqlite3Accessor) Migrate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (db *Sqlite3Accessor) FindLatestBlocks(time int64, limit int) []Block {
|
||||
func (db *Sqlite3Accessor) FindLatestBlocks(mintime int64, limit int) ([]Block, error) {
|
||||
return make([]Block, 0)
|
||||
}
|
||||
|
||||
func (db *Sqlite3Accessor) FindBlocks(posx int, posz int, posystart int, posyend int) []Block {
|
||||
func (db *Sqlite3Accessor) FindBlocks(posx int, posz int, posystart int, posyend int) ([]Block, error) {
|
||||
return make([]Block, 0)
|
||||
}
|
||||
|
||||
func (db *Sqlite3Accessor) GetXRange(posystart int, posyend int) (int, int) {
|
||||
return 0, 0
|
||||
func (db *Sqlite3Accessor) CountBlocks(x1, x2, y1, y2, z1, z2 int) (int, error) {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (db *Sqlite3Accessor) GetZRange(posystart int, posyend int) (int, int) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
func NewSqliteAccessor(filename string) {
|
||||
|
||||
func NewSqliteAccessor(filename string) (*Sqlite3Accessor, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user