This commit is contained in:
NatureFreshMilk 2019-02-15 09:08:22 +01:00
parent ddda7dbe60
commit 90d902e99b
15 changed files with 21 additions and 30 deletions

View File

@ -39,7 +39,7 @@ build: $(OUT_DIR)
# apt install gcc-mingw-w64
GOARCH=386 GOOS=windows CC=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86.exe
GOARCH=amd64 GOOS=windows CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86-64.exe
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
# apt install gcc-5-arm-linux-gnueabihf
GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-5 CGO_ENABLED=1 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-arm
#go test -cpuprofile cpu.prof -memprofile mem.prof -bench . ./mapblockrenderer/

View File

@ -75,8 +75,6 @@ func (m *ColorMapping) LoadBytes(buffer []byte) (int, error) {
return count, nil
}
//TODO: colors from fs
func (m *ColorMapping) LoadVFSColors(useLocal bool, filename string) (int, error) {
buffer, err := vfs.FSByte(useLocal, "/colors.txt")
if err != nil {

View File

@ -69,7 +69,6 @@ func main() {
}
//Start http server
//TODO: defer, may cause race condition
web.Serve(ctx)
}

View File

@ -7,8 +7,8 @@ import (
"mapserver/mapblockparser"
cache "github.com/patrickmn/go-cache"
"github.com/sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
)
type FindMapBlocksByMtimeResult struct {

View File

@ -8,8 +8,6 @@ import (
"strconv"
)
//TODO: mapdata struct with accessors
func parseMapdata(mapblock *MapBlock, data []byte) (int, error) {
r := bytes.NewReader(data)

View File

@ -2,9 +2,9 @@ package mapblockparser
import (
"errors"
"github.com/prometheus/client_golang/prometheus"
"mapserver/coords"
"strconv"
"github.com/prometheus/client_golang/prometheus"
)
func Parse(data []byte, mtime int64, pos *coords.MapBlockCoords) (*MapBlock, error) {

View File

@ -10,8 +10,8 @@ import (
"mapserver/mapblockaccessor"
"time"
"github.com/sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
)
type MapBlockRenderer struct {

View File

@ -6,7 +6,6 @@ import (
"github.com/dgraph-io/badger"
"github.com/prometheus/client_golang/prometheus"
)
func New(path string) (*TileDB, error) {

View File

@ -12,8 +12,8 @@ import (
"mapserver/layer"
"mapserver/mapblockrenderer"
"mapserver/tiledb"
"time"
"strconv"
"time"
"github.com/disintegration/imaging"
"github.com/sirupsen/logrus"

View File

@ -2,13 +2,13 @@ package web
import (
"encoding/json"
"github.com/prometheus/client_golang/prometheus"
"mapserver/app"
"mapserver/coords"
"mapserver/mapobjectdb"
"net/http"
"strconv"
"strings"
"github.com/prometheus/client_golang/prometheus"
)
type MapObjects struct {

View File

@ -1,6 +1,7 @@
package web
import (
"github.com/prometheus/client_golang/prometheus"
"image/color"
"mapserver/app"
"mapserver/coords"
@ -8,11 +9,8 @@ import (
"net/http"
"strconv"
"strings"
"github.com/prometheus/client_golang/prometheus"
)
type Tiles struct {
ctx *app.App
blank []byte
@ -35,7 +33,6 @@ func (t *Tiles) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
timer := prometheus.NewTimer(tileServeDuration)
defer timer.ObserveDuration()
layerid, _ := strconv.Atoi(parts[0])
x, _ := strconv.Atoi(parts[1])
y, _ := strconv.Atoi(parts[2])