diff --git a/db/accessor.go b/db/accessor.go index f3b3e9b..fdb4269 100644 --- a/db/accessor.go +++ b/db/accessor.go @@ -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 } diff --git a/db/sqlite.go b/db/sqlite.go index dfd46f3..effa90f 100644 --- a/db/sqlite.go +++ b/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 }