2019-01-08 00:27:24 +03:00
|
|
|
package db
|
|
|
|
|
2019-01-09 13:11:45 +03:00
|
|
|
import (
|
2019-02-14 11:05:39 +03:00
|
|
|
"mapserver/settings"
|
2023-12-29 18:00:11 +03:00
|
|
|
"mapserver/types"
|
2019-01-09 13:11:45 +03:00
|
|
|
)
|
|
|
|
|
2019-01-08 00:27:24 +03:00
|
|
|
type Block struct {
|
2023-12-29 18:00:11 +03:00
|
|
|
Pos *types.MapBlockCoords
|
2019-01-13 18:37:03 +03:00
|
|
|
Data []byte
|
|
|
|
Mtime int64
|
2019-01-08 00:27:24 +03:00
|
|
|
}
|
|
|
|
|
2019-02-11 18:32:39 +03:00
|
|
|
type InitialBlocksResult struct {
|
2019-02-14 11:05:39 +03:00
|
|
|
List []*Block
|
2019-02-14 10:34:16 +03:00
|
|
|
UnfilteredCount int
|
2019-02-14 11:05:39 +03:00
|
|
|
HasMore bool
|
2019-02-15 11:08:22 +03:00
|
|
|
Progress float64
|
2019-02-15 19:33:49 +03:00
|
|
|
LastMtime int64
|
2019-02-11 18:32:39 +03:00
|
|
|
}
|
|
|
|
|
2019-01-08 00:27:24 +03:00
|
|
|
type DBAccessor interface {
|
|
|
|
Migrate() error
|
2019-01-24 17:56:37 +03:00
|
|
|
|
2019-04-03 09:15:32 +03:00
|
|
|
GetTimestamp() (int64, error)
|
2019-02-06 10:38:08 +03:00
|
|
|
FindBlocksByMtime(gtmtime int64, limit int) ([]*Block, error)
|
2023-12-29 18:00:11 +03:00
|
|
|
FindNextInitialBlocks(s settings.Settings, layers []*types.Layer, limit int) (*InitialBlocksResult, error)
|
|
|
|
GetBlock(pos *types.MapBlockCoords) (*Block, error)
|
2019-01-08 00:27:24 +03:00
|
|
|
}
|