forked from MTSR/mapserver
go fmt
This commit is contained in:
parent
52b29dbd47
commit
a0a8569168
@ -15,7 +15,7 @@ type Config struct {
|
||||
EnableRendering bool `json:"enablerendering"`
|
||||
Webdev bool `json:"webdev"`
|
||||
WebApi *WebApiConfig `json:"webapi"`
|
||||
Layers []*layer.Layer `json:"layers"`
|
||||
Layers []*layer.Layer `json:"layers"`
|
||||
RenderingFetchLimit int `json:"renderingfetchlimit"`
|
||||
RenderingJobs int `json:"renderingjobs"`
|
||||
RenderingQueue int `json:"renderingqueue"`
|
||||
|
@ -8,7 +8,7 @@ const (
|
||||
minValue = -1 << (numBitsPerComponent - 1)
|
||||
maxValue = 1<<(numBitsPerComponent-1) - 1
|
||||
|
||||
MinPlainCoord = -34351347711
|
||||
MinPlainCoord = -34351347711
|
||||
)
|
||||
|
||||
func CoordToPlain(c *MapBlockCoords) int64 {
|
||||
|
@ -12,11 +12,11 @@ func init() {
|
||||
log = logrus.WithFields(logrus.Fields{"prefix": "coords/convert_test"})
|
||||
}
|
||||
|
||||
func TestMinCoord(t *testing.T){
|
||||
func TestMinCoord(t *testing.T) {
|
||||
c := NewMapBlockCoords(MinCoord, MinCoord, MinCoord)
|
||||
pc := CoordToPlain(c)
|
||||
|
||||
log.WithFields(logrus.Fields{"coords": c, "plain": pc,"plain-1": pc-1}).Info("TestMinCoord")
|
||||
log.WithFields(logrus.Fields{"coords": c, "plain": pc, "plain-1": pc - 1}).Info("TestMinCoord")
|
||||
if pc != MinPlainCoord {
|
||||
t.Fatal("no min match")
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ package db
|
||||
|
||||
import (
|
||||
"mapserver/coords"
|
||||
"mapserver/settings"
|
||||
"mapserver/layer"
|
||||
"mapserver/settings"
|
||||
)
|
||||
|
||||
type Block struct {
|
||||
@ -13,9 +13,9 @@ type Block struct {
|
||||
}
|
||||
|
||||
type InitialBlocksResult struct {
|
||||
List []*Block
|
||||
List []*Block
|
||||
UnfilteredCount int
|
||||
HasMore bool
|
||||
HasMore bool
|
||||
}
|
||||
|
||||
type DBAccessor interface {
|
||||
|
@ -1,12 +1,14 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"mapserver/settings"
|
||||
"mapserver/layer"
|
||||
"mapserver/db"
|
||||
"mapserver/layer"
|
||||
"mapserver/settings"
|
||||
)
|
||||
|
||||
|
||||
const (
|
||||
SETTING_LAST_LAYER = "last_layer"
|
||||
)
|
||||
|
||||
func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers []*layer.Layer, limit int) (*db.InitialBlocksResult, error) {
|
||||
return nil, nil
|
||||
|
@ -1,6 +1,5 @@
|
||||
package postgres
|
||||
|
||||
|
||||
const getBlocksByMtimeQuery = `
|
||||
select posx,posy,posz,data,mtime
|
||||
from blocks b
|
||||
@ -9,17 +8,6 @@ order by b.mtime asc
|
||||
limit ?
|
||||
`
|
||||
|
||||
const getLastBlockQuery = `
|
||||
select posx,posy,posz,data,mtime
|
||||
from blocks b
|
||||
where b.mtime = 0
|
||||
and b.posx >= ?
|
||||
and b.posy >= ?
|
||||
and b.posz >= ?
|
||||
order by b.posx asc, b.posy asc, b.posz asc, b.mtime asc
|
||||
limit ?
|
||||
`
|
||||
|
||||
const countBlocksQuery = `
|
||||
select count(*) from blocks b where b.mtime >= ? and b.mtime <= ?
|
||||
`
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"mapserver/coords"
|
||||
"mapserver/db"
|
||||
"mapserver/settings"
|
||||
"mapserver/layer"
|
||||
"mapserver/settings"
|
||||
)
|
||||
|
||||
const (
|
||||
SETTING_LAST_POS = "last_pos"
|
||||
SETTING_LAST_POS = "last_pos"
|
||||
)
|
||||
|
||||
const getLastBlockQuery = `
|
||||
|
@ -3,8 +3,8 @@ package mapblockaccessor
|
||||
import (
|
||||
"mapserver/eventbus"
|
||||
"mapserver/layer"
|
||||
"mapserver/settings"
|
||||
"mapserver/mapblockparser"
|
||||
"mapserver/settings"
|
||||
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -1,6 +1,5 @@
|
||||
package sqlite
|
||||
|
||||
|
||||
const getMapDataPosQuery = `
|
||||
select o.id, o.type, o.mtime,
|
||||
o.x, o.y, o.z,
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
//Public facing config
|
||||
type PublicConfig struct {
|
||||
Layers []*layer.Layer `json:"layers"`
|
||||
Layers []*layer.Layer `json:"layers"`
|
||||
MapObjects *app.MapObjectConfig `json:"mapobjects"`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user