Skip to content

Commit

Permalink
doc: updated Iterator behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronoaldo committed Dec 2, 2023
1 parent a49b3e7 commit d347777
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ func (b *Block) String() string {
}

// BlockRepository implementes data access layer for the Minetest map data.
// All positions are in mapblock coordinates, as described here:
// https://github.com/minetest/minetest/blob/master/doc/lua_api.md#mapblock-coordinates
type BlockRepository interface {
types.Backup

// GetByPost returns the map block at positions X,Y,Z.
GetByPos(x, y, z int) (*Block, error)

// Iterator returns a channel to fetch all data from the starting position
// X,Y,Z, with the map blocks sorted by position ascending. Sorting is done
// by X,Y and Z coordinates.
// X,Y,Z (exclusive), with the map blocks sorted by position ascending.
// Sorting is done by Z, Y, X to keep consistency with Sqlite map format.
Iterator(x, y, z int) (chan *Block, types.Closer, error)

// Update upserts the provided map block in the database, using the position
Expand Down

0 comments on commit d347777

Please sign in to comment.