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