Merge branch 'develop' into frank-dev2
# Conflicts: # cmd/server/server.go # templates/index.html
This commit is contained in:
commit
26014b0c34
164
.gitignore
vendored
Normal file
164
.gitignore
vendored
Normal file
@ -0,0 +1,164 @@
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/macos,go,intellij
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,go,intellij
|
||||
|
||||
### Go ###
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
### Go Patch ###
|
||||
/vendor/
|
||||
/Godeps/
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
||||
.idea/**/sonarlint/
|
||||
|
||||
# SonarQube Plugin
|
||||
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
||||
.idea/**/sonarIssues.xml
|
||||
|
||||
# Markdown Navigator plugin
|
||||
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
||||
.idea/**/markdown-navigator.xml
|
||||
.idea/**/markdown-navigator-enh.xml
|
||||
.idea/**/markdown-navigator/
|
||||
|
||||
# Cache file creation bug
|
||||
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
||||
.idea/$CACHE_FILE$
|
||||
|
||||
# CodeStream plugin
|
||||
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||
.idea/codestream.xml
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/macos,go,intellij
|
||||
|
||||
# CUSTOM
|
||||
.env
|
||||
gpsconfig.yml
|
||||
config.yml
|
||||
_db
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
@ -1,21 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
)
|
||||
|
||||
const (
|
||||
SERIAL_PORT = "/dev/tty.usbmodem14201"
|
||||
)
|
||||
|
||||
func main() {
|
||||
core.SerialCollector(&printer{}, SERIAL_PORT)
|
||||
}
|
||||
|
||||
type printer struct{}
|
||||
|
||||
func (p *printer) Process(data *core.Sensordata) error {
|
||||
fmt.Println(data)
|
||||
return nil
|
||||
}
|
||||
@ -2,29 +2,48 @@ package main
|
||||
|
||||
import (
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
"log"
|
||||
)
|
||||
|
||||
const (
|
||||
TCP_PORT = ":3010"
|
||||
HTTP_PORT = ":3011"
|
||||
SERIAL_PORT = "COM6"
|
||||
"git.timovolkmann.de/gyrogpsc/storage"
|
||||
"git.timovolkmann.de/gyrogpsc/web"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("setup dispatcher")
|
||||
dispatcher := core.NewDispatcher()
|
||||
log.Println("initialize processing pipeline")
|
||||
processor := core.NewPipeline(dispatcher, 50, 494)
|
||||
processor.Run()
|
||||
collectRoutines(processor)
|
||||
log.Println("start http server")
|
||||
core.HttpListenAndServe(dispatcher, HTTP_PORT)
|
||||
conf := configurationFromFile()
|
||||
|
||||
repo := storage.NewRepository(conf)
|
||||
disp := core.NewDispatcher()
|
||||
|
||||
service := core.TrackingService(repo, disp, conf)
|
||||
|
||||
web.CreateServer(service, disp, conf)
|
||||
}
|
||||
|
||||
func collectRoutines(proc core.Processor) {
|
||||
// collect Sensor data from Serial UBX in Goroutine
|
||||
go core.SerialCollector(proc, SERIAL_PORT)
|
||||
// collect Sensor data from JSON over TCP in Goroutine
|
||||
go core.TcpCollector(proc, TCP_PORT)
|
||||
func configurationFromFile() *core.Configuration {
|
||||
viper.SetDefault("collectors.porttcp", ":3010")
|
||||
viper.SetDefault("collectors.portserial", "/dev/tty.usbmodem14201")
|
||||
viper.SetDefault("webserver.port", ":3011")
|
||||
viper.SetDefault("pipeline.publishIntervalMs", 50)
|
||||
viper.SetDefault("pipeline.syncUpdateIntervalMs", 494)
|
||||
viper.SetDefault("debuglevel", "INFO")
|
||||
|
||||
viper.SetConfigName("gpsconfig") // name of config file (without extension)
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
viper.AddConfigPath("./../../")
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
logrus.Warn("couldn't find config file. using standard configuration")
|
||||
}
|
||||
|
||||
c := core.Configuration{}
|
||||
if err := viper.Unmarshal(&c); err != nil {
|
||||
logrus.Debug("couldn't load config...")
|
||||
logrus.Error(err)
|
||||
}
|
||||
lvl, err := logrus.ParseLevel(c.Debuglevel)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
logrus.SetLevel(lvl)
|
||||
return &c
|
||||
}
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
"log"
|
||||
)
|
||||
|
||||
const (
|
||||
TCP_PORT = ":3010"
|
||||
HTTP_PORT = ":3011"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("setup dispatcher")
|
||||
dispatcher := core.NewDispatcher()
|
||||
log.Println("initialize processing pipeline")
|
||||
processor := core.NewPipeline(dispatcher, 50, 494)
|
||||
processor.Run()
|
||||
collectRoutines(processor)
|
||||
log.Println("start http server")
|
||||
core.HttpListenAndServe(dispatcher, HTTP_PORT)
|
||||
}
|
||||
|
||||
func collectRoutines(proc core.Processor) {
|
||||
// collect Sensor data from JSON over TCP in Goroutine
|
||||
go core.TcpCollector(proc, TCP_PORT)
|
||||
}
|
||||
83
cmd/test/autorun.go
Normal file
83
cmd/test/autorun.go
Normal file
@ -0,0 +1,83 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
"git.timovolkmann.de/gyrogpsc/storage"
|
||||
"git.timovolkmann.de/gyrogpsc/web"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
//f, err := os.Create("_profile.pprof")
|
||||
//if err != nil {
|
||||
// logrus.Fatal(err)
|
||||
//}
|
||||
//pprof.StartCPUProfile(f)
|
||||
go func() {
|
||||
logrus.Println(http.ListenAndServe("localhost:6060", nil))
|
||||
}()
|
||||
//defer pprof.StopCPUProfile()
|
||||
|
||||
conf := configurationFromFile()
|
||||
|
||||
repo := storage.NewRepository(conf)
|
||||
disp := core.NewDispatcher()
|
||||
|
||||
service := core.TrackingService(repo, disp, conf)
|
||||
|
||||
go func() {
|
||||
service.StartPipeline(core.TCP, core.SERIAL)
|
||||
time.Sleep(5 * time.Second)
|
||||
service.StartRecord()
|
||||
time.Sleep(10 * time.Second)
|
||||
service.StopRecord()
|
||||
time.Sleep(5 * time.Second)
|
||||
service.StartPipeline(core.TCP, core.SERIAL)
|
||||
time.Sleep(5 * time.Second)
|
||||
service.StartRecord()
|
||||
time.Sleep(60 * time.Second)
|
||||
service.StopRecord()
|
||||
time.Sleep(2 * time.Second)
|
||||
service.StopAll()
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
//pprof.StopCPUProfile()
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
web.CreateServer(service, disp, conf)
|
||||
}
|
||||
|
||||
func configurationFromFile() *core.Configuration {
|
||||
viper.SetDefault("collectors.porttcp", ":3010")
|
||||
viper.SetDefault("collectors.portserial", "/dev/tty.usbmodem14201")
|
||||
viper.SetDefault("webserver.port", ":3011")
|
||||
viper.SetDefault("pipeline.publishIntervalMs", 50)
|
||||
viper.SetDefault("pipeline.syncUpdateIntervalMs", 494)
|
||||
viper.SetDefault("debuglevel", "INFO")
|
||||
|
||||
viper.SetConfigName("gpsconfig") // name of config file (without extension)
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
viper.AddConfigPath("./../../")
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
logrus.Warn("couldn't find config file. using standard configuration")
|
||||
}
|
||||
|
||||
c := core.Configuration{}
|
||||
if err := viper.Unmarshal(&c); err != nil {
|
||||
logrus.Debug("couldn't load config...")
|
||||
logrus.Error(err)
|
||||
}
|
||||
lvl, err := logrus.ParseLevel(c.Debuglevel)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
logrus.SetLevel(lvl)
|
||||
return &c
|
||||
}
|
||||
@ -2,41 +2,182 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"git.timovolkmann.de/gyrogpsc/ublox"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.bug.st/serial"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"git.timovolkmann.de/gyrogpsc/ublox"
|
||||
"go.bug.st/serial"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TcpCollector(proc Processor, tcpPort string) {
|
||||
log.Println("start tcp collectors")
|
||||
type Collector interface {
|
||||
Collect()
|
||||
Close()
|
||||
}
|
||||
|
||||
listener, err := net.Listen("tcp", tcpPort)
|
||||
if err != nil {
|
||||
fmt.Println("Error listening:", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
// Close the listener when the application closes.
|
||||
defer listener.Close()
|
||||
type CollectorType string
|
||||
|
||||
for {
|
||||
// Listen for an incoming connection.
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
fmt.Println("Error accepting: ", err.Error())
|
||||
os.Exit(1)
|
||||
const (
|
||||
SERIAL CollectorType = "SERIAL_COLLECTOR" //"\x00SERIAL?/"
|
||||
TCP CollectorType = "TCP_COLLECTOR" //"\x00TCP?/"
|
||||
)
|
||||
|
||||
var tcpSingleton *tcpCollector
|
||||
|
||||
func NewCollector(typ CollectorType, proc Pusher, config *Configuration) Collector {
|
||||
var coll Collector
|
||||
switch typ {
|
||||
case SERIAL:
|
||||
coll = newSerial(proc, config)
|
||||
case TCP:
|
||||
if tcpSingleton == nil {
|
||||
tcpSingleton = newTcp(proc, config)
|
||||
} else {
|
||||
tcpSingleton.SetProcessor(proc)
|
||||
}
|
||||
log.Println("...new incoming tcp connection...")
|
||||
coll = tcpSingleton
|
||||
default:
|
||||
panic("selected collector type not implemented")
|
||||
}
|
||||
return coll
|
||||
}
|
||||
|
||||
// Handle connections in a new goroutine.
|
||||
go jsonHandler(conn, proc)
|
||||
type serialCollector struct {
|
||||
active bool
|
||||
proc Pusher
|
||||
config *Configuration
|
||||
mu sync.RWMutex
|
||||
}
|
||||
|
||||
func (s *serialCollector) isSerialCollActive() bool {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.active
|
||||
}
|
||||
|
||||
func (s *serialCollector) Collect() {
|
||||
s.mu.Lock()
|
||||
s.active = true
|
||||
s.mu.Unlock()
|
||||
go func() {
|
||||
logrus.Println("start serial collector")
|
||||
mode := &serial.Mode{
|
||||
BaudRate: 115200,
|
||||
}
|
||||
port, err := serial.Open(s.config.Collectors.SerialCollectorPort, mode)
|
||||
if err != nil {
|
||||
logrus.Warn("can't open serial port:", err)
|
||||
//if e, ok := err.(serial.PortError); ok && e.Code() == serial.PortBusy {
|
||||
for i := 3; i < 20; i = i + 2 {
|
||||
logrus.Warnf("try again in -> %vms", i*i)
|
||||
time.Sleep(time.Millisecond * time.Duration(i*i))
|
||||
port, err = serial.Open(s.config.Collectors.SerialCollectorPort, mode)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
//}
|
||||
}
|
||||
defer port.Close()
|
||||
|
||||
decoder := ublox.NewDecoder(port)
|
||||
|
||||
for s.isSerialCollActive() {
|
||||
meas, err := decoder.Decode()
|
||||
if err != nil {
|
||||
if err.Error() == "NMEA not implemented" {
|
||||
continue
|
||||
}
|
||||
logrus.Println("serial read err:", err)
|
||||
break
|
||||
}
|
||||
sd, err := ConvertUbxToSensorData(meas)
|
||||
if err != nil {
|
||||
logrus.Println("convert err:", err, meas, sd)
|
||||
continue
|
||||
}
|
||||
// skip irrelevant messages
|
||||
if sd == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
err = s.proc.Push(sd)
|
||||
if err != nil {
|
||||
logrus.Println("process err:", err, *sd)
|
||||
continue
|
||||
}
|
||||
}
|
||||
logrus.Println("serial collector stopped")
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *serialCollector) Close() {
|
||||
s.mu.Lock()
|
||||
s.active = false
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
func newSerial(proc Pusher, config *Configuration) *serialCollector {
|
||||
return &serialCollector{
|
||||
active: false,
|
||||
proc: proc,
|
||||
config: config,
|
||||
}
|
||||
}
|
||||
|
||||
type tcpCollector struct {
|
||||
active bool
|
||||
processor Pusher
|
||||
//config *Configuration
|
||||
}
|
||||
|
||||
func (t *tcpCollector) Collect() {
|
||||
t.active = true
|
||||
}
|
||||
|
||||
func (t *tcpCollector) Close() {
|
||||
t.active = false
|
||||
}
|
||||
|
||||
func (t *tcpCollector) SetProcessor(p Pusher) {
|
||||
t.processor = p
|
||||
}
|
||||
|
||||
func newTcp(proc Pusher, config *Configuration) *tcpCollector {
|
||||
logrus.Println("start tcp collector")
|
||||
|
||||
listener, err := net.Listen("tcp", config.Collectors.TcpCollectorPort)
|
||||
if err != nil {
|
||||
fmt.Println("Error listening:", err)
|
||||
//os.Exit(1)
|
||||
}
|
||||
coll := &tcpCollector{
|
||||
active: false,
|
||||
processor: proc,
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
// Listen for an incoming connection.
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
fmt.Println("Error accepting: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
logrus.Println("...new incoming tcp connection...")
|
||||
|
||||
// Handle connections in a new goroutine.
|
||||
go coll.jsonHandler(conn)
|
||||
}
|
||||
}()
|
||||
return coll
|
||||
}
|
||||
|
||||
// handles incoming tcp connections with json payload.
|
||||
func jsonHandler(conn net.Conn, proc Processor) {
|
||||
func (c *tcpCollector) jsonHandler(conn net.Conn) {
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
@ -54,52 +195,16 @@ func jsonHandler(conn net.Conn, proc Processor) {
|
||||
//fmt.Println(string(buf[:n]))
|
||||
sd, err := ConvertSensorDataPhone(buf[:n])
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
logrus.Println(err)
|
||||
continue
|
||||
}
|
||||
|
||||
err = proc.Process(sd)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func SerialCollector(proc Processor, serialPort string) {
|
||||
log.Println("start serial collectors")
|
||||
mode := &serial.Mode{
|
||||
BaudRate: 115200,
|
||||
}
|
||||
port, err := serial.Open(serialPort, mode)
|
||||
if err != nil {
|
||||
log.Fatalln(err.Error())
|
||||
}
|
||||
|
||||
decoder := ublox.NewDecoder(port)
|
||||
|
||||
for {
|
||||
meas, err := decoder.Decode()
|
||||
if err != nil {
|
||||
if err.Error() == "NMEA not implemented" {
|
||||
continue
|
||||
}
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
sd, err := ConvertUbxToSensorData(meas)
|
||||
if err != nil {
|
||||
log.Println("convert err:", err, meas)
|
||||
continue
|
||||
}
|
||||
if sd == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
err = proc.Process(sd)
|
||||
if err != nil {
|
||||
log.Println("process err:", err, *sd)
|
||||
if !c.active {
|
||||
//time.Sleep(50 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
err = c.processor.Push(sd)
|
||||
if err != nil {
|
||||
logrus.Fatalln(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
core/config.go
Normal file
16
core/config.go
Normal file
@ -0,0 +1,16 @@
|
||||
package core
|
||||
|
||||
type Configuration struct {
|
||||
Collectors struct {
|
||||
TcpCollectorPort string `mapstructure:"porttcp"`
|
||||
SerialCollectorPort string `mapstructure:"portserial"`
|
||||
} `mapstructure:"Collectors"`
|
||||
Webserver struct {
|
||||
Port string `mapstructure:"port"`
|
||||
} `mapstructure:"webserver"`
|
||||
Pipeline struct {
|
||||
PublishIntervalMs int `mapstructure:"publishintervalms"`
|
||||
SyncUpdateIntervalMs int `mapstructure:"syncupdateintervalms"`
|
||||
} `mapstructure:"pipeline"`
|
||||
Debuglevel string `mapstructure:"debuglevel"`
|
||||
}
|
||||
@ -2,18 +2,9 @@ package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Subscriber interface {
|
||||
Subscribe() (int16, <-chan string)
|
||||
Unsubscribe(id int16) error
|
||||
}
|
||||
|
||||
type Publisher interface {
|
||||
Publish(message string)
|
||||
}
|
||||
|
||||
type dispatcher struct {
|
||||
listeners map[int16]chan string
|
||||
counter int16
|
||||
@ -27,7 +18,8 @@ func NewDispatcher() *dispatcher {
|
||||
}
|
||||
|
||||
func (d *dispatcher) Publish(message string) {
|
||||
log.Printf("publish to %v listeners:\n%v\n", len(d.listeners), message)
|
||||
logrus.Debugf("publish to %v listeners\n", len(d.listeners))
|
||||
logrus.Debug(message)
|
||||
for _, ch := range d.listeners {
|
||||
ch <- message
|
||||
}
|
||||
|
||||
71
core/http.go
71
core/http.go
@ -1,71 +0,0 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gorilla/websocket"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func echo(sub Subscriber) func(w http.ResponseWriter, r *http.Request) {
|
||||
var upgrader = websocket.Upgrader{} // use default options
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println("upgrading to ws")
|
||||
c, err := upgrader.Upgrade(w, r, nil)
|
||||
if err != nil {
|
||||
log.Print("upgrade:", err)
|
||||
return
|
||||
}
|
||||
//defer c.Close()
|
||||
go func() {
|
||||
for {
|
||||
if _, _, err := c.NextReader(); err != nil {
|
||||
c.Close()
|
||||
break
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
dispatcherId, channel := sub.Subscribe()
|
||||
defer sub.Unsubscribe(dispatcherId)
|
||||
for {
|
||||
//log.Println("")
|
||||
//if err != nil {
|
||||
// log.Println("read:", err)
|
||||
// break
|
||||
//}
|
||||
cmsg := <-channel
|
||||
err = c.WriteMessage(websocket.TextMessage, []byte(cmsg))
|
||||
if err != nil {
|
||||
log.Println("write:", err)
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func home(w http.ResponseWriter, r *http.Request) {
|
||||
//var homeTemplate = template.Must(template.NewDispatcher("").ParseFiles("index.html"))
|
||||
tpl, err := template.ParseFiles("static/index.html")
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
err = tpl.Execute(w, "ws://"+r.Host+"/echo")
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
|
||||
func HttpListenAndServe(sub Subscriber, httpPort string) {
|
||||
log.Println("register websocket handler")
|
||||
http.HandleFunc("/echo", echo(sub))
|
||||
log.Println("register index handler")
|
||||
http.HandleFunc("/", home)
|
||||
log.Println("register static file handler")
|
||||
http.Handle("/static/", http.FileServer(http.Dir(".")))
|
||||
|
||||
log.Println("start server")
|
||||
log.Fatal(http.ListenAndServe(httpPort, nil))
|
||||
}
|
||||
27
core/interfaces.go
Normal file
27
core/interfaces.go
Normal file
@ -0,0 +1,27 @@
|
||||
package core
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type Subscriber interface {
|
||||
Subscribe() (int16, <-chan string)
|
||||
Unsubscribe(id int16) error
|
||||
}
|
||||
|
||||
type Publisher interface {
|
||||
Publish(message string)
|
||||
}
|
||||
|
||||
type Pusher interface {
|
||||
Push(data *sensorData) error
|
||||
}
|
||||
|
||||
type Storer interface {
|
||||
EnqueuePair(tcp sensorData, ser sensorData)
|
||||
EnqueueRaw(data sensorData)
|
||||
}
|
||||
|
||||
type Repo interface {
|
||||
Save(tracking Tracking) error
|
||||
LoadAll() ([]TrackingMetadata, error)
|
||||
Load(id uuid.UUID) (Tracking, error)
|
||||
}
|
||||
254
core/pipeline.go
254
core/pipeline.go
@ -1,169 +1,227 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/sync/semaphore"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// TODO: adapt HNR-INS data to continue orientation stream
|
||||
|
||||
type Processor interface {
|
||||
Process(data *Sensordata) error
|
||||
}
|
||||
|
||||
type pipeline struct {
|
||||
syn synchronizer
|
||||
agr aggregator
|
||||
pub Publisher
|
||||
active bool
|
||||
record bool
|
||||
synchroniz synchronizer
|
||||
buffer pipeBuffer
|
||||
publisher Publisher
|
||||
storer Storer
|
||||
publishTicker *time.Ticker
|
||||
mu sync.RWMutex
|
||||
sema *semaphore.Weighted
|
||||
}
|
||||
|
||||
func NewPipeline(d Publisher, publishIntervalMs int, delayUpdateIntervalMs int) *pipeline {
|
||||
// pipe implements Runner & Pusher
|
||||
func NewPipeline(d Publisher, s Storer, conf *Configuration) *pipeline {
|
||||
return &pipeline{
|
||||
false,
|
||||
false,
|
||||
synchronizer{
|
||||
//bufferSize: 100,
|
||||
mutex: &sync.Mutex{},
|
||||
updateTicker: time.NewTicker(time.Duration(delayUpdateIntervalMs) * time.Millisecond),
|
||||
mutex: &sync.RWMutex{},
|
||||
updateTicker: time.NewTicker(time.Duration(conf.Pipeline.SyncUpdateIntervalMs) * time.Millisecond),
|
||||
},
|
||||
aggregator{
|
||||
pipeBuffer{
|
||||
tcpMutex: &sync.Mutex{},
|
||||
serialMutex: &sync.Mutex{},
|
||||
},
|
||||
d,
|
||||
time.NewTicker(time.Duration(publishIntervalMs) * time.Millisecond),
|
||||
s,
|
||||
time.NewTicker(time.Duration(conf.Pipeline.PublishIntervalMs) * time.Millisecond),
|
||||
sync.RWMutex{},
|
||||
semaphore.NewWeighted(2),
|
||||
}
|
||||
}
|
||||
|
||||
func (p *pipeline) isPipeActive() bool {
|
||||
p.mu.RLock()
|
||||
defer p.mu.RUnlock()
|
||||
return p.active
|
||||
}
|
||||
|
||||
func (p *pipeline) Run() {
|
||||
go p.scheduleSynchronizer()
|
||||
p.sema.Acquire(context.Background(), 2)
|
||||
p.mu.Lock()
|
||||
p.active = true
|
||||
p.mu.Unlock()
|
||||
logrus.Println("pipe: processing service started")
|
||||
go func() {
|
||||
for {
|
||||
<-p.publishTicker.C
|
||||
err := p.Publish()
|
||||
if err != nil && err.Error() != "no data available" {
|
||||
log.Println(err)
|
||||
for p.isPipeActive() {
|
||||
<-p.synchroniz.updateTicker.C
|
||||
err := p.refreshDelay()
|
||||
if err != nil {
|
||||
logrus.Debugln(err)
|
||||
}
|
||||
}
|
||||
p.sema.Release(1)
|
||||
logrus.Println("pipe: updater stopped")
|
||||
}()
|
||||
go func() {
|
||||
for p.isPipeActive() {
|
||||
<-p.publishTicker.C
|
||||
err := p.publish()
|
||||
if err != nil && err.Error() != "no data available" {
|
||||
logrus.Debug(err)
|
||||
}
|
||||
}
|
||||
p.sema.Release(1)
|
||||
logrus.Println("pipe: publisher stopped")
|
||||
}()
|
||||
log.Println("pipeline: processing service started")
|
||||
}
|
||||
|
||||
func (p *pipeline) Publish() error {
|
||||
p.agr.tcpMutex.Lock()
|
||||
p.agr.serialMutex.Lock()
|
||||
//log.Println(pub.tcpSensorData)
|
||||
//log.Println(pub.serialSensorData)
|
||||
if (p.agr.tcpSensorData == Sensordata{} && p.agr.serialSensorData == Sensordata{}) {
|
||||
p.agr.tcpMutex.Unlock()
|
||||
p.agr.serialMutex.Unlock()
|
||||
func (p *pipeline) Record() {
|
||||
p.record = true
|
||||
}
|
||||
func (p *pipeline) StopRecord() {
|
||||
p.record = false
|
||||
}
|
||||
|
||||
func (p *pipeline) publish() error {
|
||||
p.buffer.tcpMutex.Lock()
|
||||
p.buffer.serialMutex.Lock()
|
||||
|
||||
if (p.buffer.MeasTcp == sensorData{} && p.buffer.MeasSerial == sensorData{}) {
|
||||
p.buffer.tcpMutex.Unlock()
|
||||
p.buffer.serialMutex.Unlock()
|
||||
return errors.New("no data available")
|
||||
}
|
||||
data := map[string]Sensordata{
|
||||
string(SOURCE_TCP): p.agr.tcpSensorData,
|
||||
string(SOURCE_SERIAL): p.agr.serialSensorData,
|
||||
if cmp.Equal(p.buffer.MeasTcp, p.buffer.LastMeasTcp, cmpopts.IgnoreUnexported(sensorData{})) &&
|
||||
cmp.Equal(p.buffer.MeasSerial, p.buffer.LastMeasSerial, cmpopts.IgnoreUnexported(sensorData{})) {
|
||||
p.buffer.tcpMutex.Unlock()
|
||||
p.buffer.serialMutex.Unlock()
|
||||
return errors.New("same data")
|
||||
}
|
||||
//p.agr.tcpSensorData = Sensordata{}
|
||||
//p.agr.serialSensorData = Sensordata{}
|
||||
p.agr.tcpMutex.Unlock()
|
||||
p.agr.serialMutex.Unlock()
|
||||
logrus.Debug("––––––––––––––––––––––––––––––––––––")
|
||||
logrus.Debugf("SER old: %v", p.buffer.LastMeasSerial)
|
||||
logrus.Debugf("SER new: %v", p.buffer.MeasSerial)
|
||||
logrus.Debugf("TCP old: %v", p.buffer.LastMeasTcp)
|
||||
logrus.Debugf("TCP new: %v", p.buffer.MeasTcp)
|
||||
logrus.Debug("––––––––––––––––––––––––––––––––––––")
|
||||
p.buffer.LastMeasTcp = p.buffer.MeasTcp
|
||||
p.buffer.LastMeasSerial = p.buffer.MeasSerial
|
||||
p.storer.EnqueuePair(p.buffer.MeasTcp, p.buffer.MeasSerial)
|
||||
|
||||
data := map[string]sensorData{
|
||||
string(SOURCE_TCP): p.buffer.MeasTcp,
|
||||
string(SOURCE_SERIAL): p.buffer.MeasSerial,
|
||||
}
|
||||
|
||||
p.buffer.tcpMutex.Unlock()
|
||||
p.buffer.serialMutex.Unlock()
|
||||
|
||||
jdata, err := json.Marshal(data)
|
||||
//log.Println(string(pretty.Pretty(jdata)))
|
||||
//logrus.Println(string(pretty.Pretty(jdata)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.pub.Publish(string(jdata))
|
||||
p.publisher.Publish(string(jdata))
|
||||
return nil
|
||||
}
|
||||
|
||||
type aggregator struct {
|
||||
tcpSensorData Sensordata
|
||||
serialSensorData Sensordata
|
||||
tcpMutex *sync.Mutex
|
||||
serialMutex *sync.Mutex
|
||||
type pipeBuffer struct {
|
||||
MeasTcp sensorData
|
||||
MeasSerial sensorData
|
||||
LastMeasTcp sensorData
|
||||
LastMeasSerial sensorData
|
||||
tcpMutex *sync.Mutex
|
||||
serialMutex *sync.Mutex
|
||||
}
|
||||
|
||||
type UnixNanoTime int64
|
||||
|
||||
type synchronizer struct {
|
||||
tcpSerialDelayMs int64
|
||||
//tcpBuffer map[UnixNanoTime]Sensordata
|
||||
//serialBuffer map[UnixNanoTime]Sensordata
|
||||
//bufferSize int
|
||||
mutex *sync.Mutex
|
||||
updateTicker *time.Ticker
|
||||
// should run concurrently
|
||||
//
|
||||
// Methods:
|
||||
// pushSensordata(Sensordata), remove oldest if larger than bufferSize
|
||||
// refreshDelay()
|
||||
// Schedule()
|
||||
}
|
||||
|
||||
func (p *pipeline) scheduleSynchronizer() {
|
||||
log.Println("synchronizer: started")
|
||||
for {
|
||||
<-p.syn.updateTicker.C
|
||||
err := p.refreshDelay()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
tcpSerialDelayMs int64
|
||||
mutex *sync.RWMutex
|
||||
updateTicker *time.Ticker
|
||||
}
|
||||
|
||||
func (p *pipeline) refreshDelay() error {
|
||||
log.Println("refreshing delay....")
|
||||
fmt.Println("Delay TCP/SERIAL", p.syn.tcpSerialDelayMs)
|
||||
p.agr.serialMutex.Lock()
|
||||
p.agr.tcpMutex.Lock()
|
||||
tcpTime := time.Unix(0, p.agr.tcpSensorData.Timestamp)
|
||||
serTime := time.Unix(0, p.agr.serialSensorData.Timestamp)
|
||||
p.agr.serialMutex.Unlock()
|
||||
p.agr.tcpMutex.Unlock()
|
||||
if tcpTime.UnixNano() == 0 || serTime.UnixNano() == 0 {
|
||||
return errors.New("no sync possible. no data to compare")
|
||||
p.synchroniz.mutex.RLock()
|
||||
if p.synchroniz.tcpSerialDelayMs != 0 {
|
||||
logrus.Println("Delay TCP/SERIAL", p.synchroniz.tcpSerialDelayMs)
|
||||
}
|
||||
log.Println("TCP", tcpTime.String())
|
||||
log.Println("SER", serTime.String())
|
||||
log.Println("Difference", tcpTime.Sub(serTime).Milliseconds())
|
||||
p.synchroniz.mutex.RUnlock()
|
||||
p.buffer.serialMutex.Lock()
|
||||
p.buffer.tcpMutex.Lock()
|
||||
tcpTime := time.Unix(0, p.buffer.MeasTcp.Timestamp)
|
||||
serTime := time.Unix(0, p.buffer.MeasSerial.Timestamp)
|
||||
p.buffer.tcpMutex.Unlock()
|
||||
p.buffer.serialMutex.Unlock()
|
||||
if tcpTime.UnixNano() == 0 || serTime.UnixNano() == 0 {
|
||||
return errors.New("no sync possible. check if both Collectors running. otherwise check GPS fix")
|
||||
}
|
||||
currentDelay := tcpTime.Sub(serTime).Milliseconds()
|
||||
if currentDelay > 5000 || currentDelay < -5000 {
|
||||
p.synchroniz.mutex.Lock()
|
||||
p.synchroniz.tcpSerialDelayMs = 0
|
||||
p.synchroniz.mutex.Unlock()
|
||||
return errors.New("skipping synchronisation! time not properly configured or facing network problems.")
|
||||
}
|
||||
logrus.Debug("TCP", tcpTime.String())
|
||||
logrus.Debug("SER", serTime.String())
|
||||
logrus.Debug("Difference", tcpTime.Sub(serTime).Milliseconds(), "ms")
|
||||
delay := tcpTime.Sub(serTime).Milliseconds()
|
||||
p.syn.tcpSerialDelayMs += delay
|
||||
p.synchroniz.mutex.Lock()
|
||||
p.synchroniz.tcpSerialDelayMs += delay
|
||||
p.synchroniz.mutex.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *pipeline) Process(data *Sensordata) error {
|
||||
func (p *pipeline) Push(data *sensorData) error {
|
||||
if data == nil {
|
||||
return errors.New("nil processing not allowed")
|
||||
}
|
||||
//log.Println(string(data.SourceId))
|
||||
switch data.SourceId {
|
||||
//logrus.Println("push data to pipe:", string(data.source))
|
||||
if p.isPipeActive() {
|
||||
p.storer.EnqueueRaw(*data)
|
||||
}
|
||||
switch data.source {
|
||||
case SOURCE_TCP:
|
||||
go p.pushTcpDataToBuffer(*data)
|
||||
case SOURCE_SERIAL:
|
||||
go p.pushSerialDataToBuffer(*data)
|
||||
default:
|
||||
return errors.New("invalid data source")
|
||||
panic("pipe: invalid data source")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *pipeline) pushTcpDataToBuffer(data Sensordata) {
|
||||
if p.syn.tcpSerialDelayMs > 0 {
|
||||
time.Sleep(time.Duration(p.syn.tcpSerialDelayMs) * time.Millisecond)
|
||||
func (p *pipeline) pushTcpDataToBuffer(data sensorData) {
|
||||
p.synchroniz.mutex.RLock()
|
||||
if p.synchroniz.tcpSerialDelayMs > 0 {
|
||||
time.Sleep(time.Duration(p.synchroniz.tcpSerialDelayMs) * time.Millisecond)
|
||||
}
|
||||
p.agr.tcpMutex.Lock()
|
||||
p.agr.tcpSensorData = p.agr.tcpSensorData.Consolidate2(data)
|
||||
p.agr.tcpMutex.Unlock()
|
||||
p.synchroniz.mutex.RLock()
|
||||
p.buffer.tcpMutex.Lock()
|
||||
p.buffer.MeasTcp = p.buffer.MeasTcp.ConsolidateExTime(data)
|
||||
p.buffer.tcpMutex.Unlock()
|
||||
}
|
||||
func (p *pipeline) pushSerialDataToBuffer(data Sensordata) {
|
||||
if p.syn.tcpSerialDelayMs < 0 {
|
||||
time.Sleep(time.Duration(-p.syn.tcpSerialDelayMs) * time.Millisecond)
|
||||
func (p *pipeline) pushSerialDataToBuffer(data sensorData) {
|
||||
p.synchroniz.mutex.RLock()
|
||||
if p.synchroniz.tcpSerialDelayMs < 0 {
|
||||
time.Sleep(time.Duration(-p.synchroniz.tcpSerialDelayMs) * time.Millisecond)
|
||||
}
|
||||
p.agr.serialMutex.Lock()
|
||||
p.agr.serialSensorData = p.agr.serialSensorData.Consolidate2(data)
|
||||
p.agr.serialMutex.Unlock()
|
||||
p.synchroniz.mutex.RUnlock()
|
||||
p.buffer.serialMutex.Lock()
|
||||
p.buffer.MeasSerial = p.buffer.MeasSerial.ConsolidateEpochsOnly(data)
|
||||
p.buffer.serialMutex.Unlock()
|
||||
}
|
||||
|
||||
func (p *pipeline) Close() {
|
||||
p.mu.Lock()
|
||||
p.active = false
|
||||
p.mu.Unlock()
|
||||
}
|
||||
|
||||
1
core/replay.go
Normal file
1
core/replay.go
Normal file
@ -0,0 +1 @@
|
||||
package core
|
||||
@ -3,25 +3,12 @@ package core
|
||||
import (
|
||||
"errors"
|
||||
"git.timovolkmann.de/gyrogpsc/ublox"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/gjson"
|
||||
"log"
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
/*{
|
||||
"smartphone": {
|
||||
// hier daten von hyperimu
|
||||
},
|
||||
"serial": {
|
||||
// hier Daten von M8U:
|
||||
"timestamp": 37539672354
|
||||
"position": [0, 0, 0],
|
||||
"orientation": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
type sourceId string
|
||||
|
||||
const (
|
||||
@ -29,90 +16,90 @@ const (
|
||||
SOURCE_SERIAL sourceId = "SOURCE_SERIAL"
|
||||
)
|
||||
|
||||
type Sensordata struct {
|
||||
type sensorData struct {
|
||||
itow uint32
|
||||
SourceId sourceId
|
||||
source sourceId
|
||||
ServerTime time.Time
|
||||
Timestamp int64
|
||||
Position [3]float64
|
||||
Orientation [3]float64
|
||||
}
|
||||
|
||||
func (s Sensordata) isSameEpoch(n Sensordata) bool {
|
||||
func (s sensorData) isSameEpoch(n sensorData) bool {
|
||||
if n.itow == 0 {
|
||||
return false
|
||||
}
|
||||
return s.itow == n.itow
|
||||
}
|
||||
|
||||
func (s Sensordata) Consolidate(n Sensordata) Sensordata {
|
||||
if (s.SourceId != n.SourceId && s != Sensordata{}) {
|
||||
log.Println(s)
|
||||
log.Println(n)
|
||||
log.Fatalln("Do not consolidate Sensordata from different Sources")
|
||||
}
|
||||
// Consolidates two sensordata elements if they are in the same epoch
|
||||
func (s sensorData) ConsolidateEpochsOnly(n sensorData) sensorData {
|
||||
s.checkSources(&n)
|
||||
if s.isSameEpoch(n) {
|
||||
null := Sensordata{}
|
||||
//if s.Timestamp == null.Timestamp { s.Timestamp = n.Timestamp }
|
||||
//if s.Position == null.Position { s.Position = n.Position }
|
||||
//if s.Orientation == null.Orientation { s.Orientation = n.Orientation }
|
||||
if n.Timestamp != null.Timestamp && s.Timestamp != n.Timestamp {
|
||||
s.Timestamp = n.Timestamp
|
||||
}
|
||||
if n.Position != null.Position && s.Position != n.Position {
|
||||
s.Position = n.Position
|
||||
}
|
||||
if n.Orientation != null.Orientation && s.Orientation != n.Orientation {
|
||||
s.Orientation = n.Orientation
|
||||
}
|
||||
null := sensorData{}
|
||||
|
||||
return s
|
||||
if n.Timestamp == null.Timestamp {
|
||||
n.Timestamp = s.Timestamp
|
||||
}
|
||||
if n.Position == null.Position {
|
||||
n.Position = s.Position
|
||||
}
|
||||
if n.Orientation == null.Orientation {
|
||||
n.Orientation = s.Orientation
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (s Sensordata) Consolidate2(n Sensordata) Sensordata {
|
||||
null := Sensordata{}
|
||||
//if s.Timestamp == null.Timestamp { s.Timestamp = n.Timestamp }
|
||||
//if s.Position == null.Position { s.Position = n.Position }
|
||||
//if s.Orientation == null.Orientation { s.Orientation = n.Orientation }
|
||||
//if n.Timestamp == null.Timestamp {
|
||||
// n.Timestamp = s.Timestamp
|
||||
//}
|
||||
// Consolidates two sensordata elements but ignores timestamps
|
||||
func (s sensorData) ConsolidateExTime(n sensorData) sensorData {
|
||||
s.checkSources(&n)
|
||||
null := sensorData{}
|
||||
|
||||
if n.Position == null.Position {
|
||||
n.Position = s.Position
|
||||
}
|
||||
if n.Orientation == null.Orientation{
|
||||
if n.Orientation == null.Orientation {
|
||||
n.Orientation = s.Orientation
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (s *sensorData) checkSources(n *sensorData) {
|
||||
if (s.source != n.source && *s != sensorData{}) {
|
||||
logrus.Println(s)
|
||||
logrus.Println(n)
|
||||
logrus.Fatalln("Do not consolidate sensorData from different Sources")
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
errNotImplemented = errors.New("message not implemented")
|
||||
errRawMessage = errors.New("raw message")
|
||||
)
|
||||
|
||||
func ConvertUbxToSensorData(msg interface{}) (*Sensordata, error) {
|
||||
sd := &Sensordata{
|
||||
SourceId: SOURCE_SERIAL,
|
||||
func ConvertUbxToSensorData(msg interface{}) (*sensorData, error) {
|
||||
sd := &sensorData{
|
||||
ServerTime: time.Now(),
|
||||
source: SOURCE_SERIAL,
|
||||
}
|
||||
switch v := msg.(type) {
|
||||
case *ublox.NavPvt:
|
||||
//log.Println("NAV-PVT")
|
||||
//logrus.Println("NAV-PVT")
|
||||
sd.itow = v.ITOW_ms
|
||||
sd.Timestamp = time.Date(int(v.Year_y), time.Month(v.Month_month), int(v.Day_d), int(v.Hour_h), int(v.Min_min), int(v.Sec_s), int(v.Nano_ns), time.UTC).UnixNano()
|
||||
sd.Position[0] = float64(v.Lat_dege7) / 1e+7
|
||||
sd.Position[1] = float64(v.Lon_dege7) / 1e+7
|
||||
sd.Position[2] = float64(v.HMSL_mm) / 1e+3 // mm in m
|
||||
case *ublox.HnrPvt:
|
||||
//log.Println("HNR-PVT")
|
||||
//logrus.Println("HNR-PVT")
|
||||
sd.itow = v.ITOW_ms
|
||||
sd.Timestamp = time.Date(int(v.Year_y), time.Month(v.Month_month), int(v.Day_d), int(v.Hour_h), int(v.Min_min), int(v.Sec_s), int(v.Nano_ns), time.UTC).UnixNano()
|
||||
sd.Position[0] = float64(v.Lat_dege7) / 1e+7
|
||||
sd.Position[1] = float64(v.Lon_dege7) / 1e+7
|
||||
sd.Position[2] = float64(v.HMSL_mm) / 1e+3 // mm in m
|
||||
case *ublox.NavAtt:
|
||||
//log.Println("NAV-ATT")
|
||||
//logrus.Println("NAV-ATT")
|
||||
sd.itow = v.ITOW_ms
|
||||
sd.Orientation[0] = float64(v.Pitch_deg) * 1e-5
|
||||
sd.Orientation[1] = float64(v.Roll_deg) * 1e-5
|
||||
@ -120,7 +107,7 @@ func ConvertUbxToSensorData(msg interface{}) (*Sensordata, error) {
|
||||
case *ublox.RawMessage:
|
||||
//class := make([]byte, 2)
|
||||
//binary.LittleEndian.PutUint16(class, v.ClassID())
|
||||
//log.Printf("%#v, %#v", class[0],class[1])
|
||||
//logrus.Printf("%#v, %#v", class[0],class[1])
|
||||
return nil, nil
|
||||
default:
|
||||
return nil, errNotImplemented
|
||||
@ -128,14 +115,14 @@ func ConvertUbxToSensorData(msg interface{}) (*Sensordata, error) {
|
||||
return sd, nil
|
||||
}
|
||||
|
||||
func ConvertSensorDataPhone(jsonData []byte) (*Sensordata, error) {
|
||||
func ConvertSensorDataPhone(jsonData []byte) (*sensorData, error) {
|
||||
if gjson.Get(string(jsonData), "os").String() == "hyperimu" {
|
||||
return convertAndroidHyperImu(jsonData)
|
||||
}
|
||||
return convertIPhoneSensorLog(jsonData)
|
||||
}
|
||||
|
||||
func convertIPhoneSensorLog(jsonData []byte) (*Sensordata, error) {
|
||||
func convertIPhoneSensorLog(jsonData []byte) (*sensorData, error) {
|
||||
timestamp := gjson.Get(string(jsonData), "locationTimestamp_since1970").Float()
|
||||
lat := gjson.Get(string(jsonData), "locationLatitude").Float()
|
||||
lon := gjson.Get(string(jsonData), "locationLongitude").Float()
|
||||
@ -143,20 +130,20 @@ func convertIPhoneSensorLog(jsonData []byte) (*Sensordata, error) {
|
||||
pitch := gjson.Get(string(jsonData), "motionPitch").Float() * 180 / math.Pi
|
||||
roll := gjson.Get(string(jsonData), "motionRoll").Float() * 180 / math.Pi
|
||||
yaw := gjson.Get(string(jsonData), "motionYaw").Float() * 180 / math.Pi
|
||||
sd := &Sensordata{
|
||||
SourceId: SOURCE_TCP,
|
||||
Timestamp: int64(timestamp * float64(time.Second)),
|
||||
//Timestamp: time.Unix(0, prep.Timestamp * int64(time.Millisecond)),
|
||||
Position: [3]float64{lat, lon, alt},
|
||||
sd := &sensorData{
|
||||
ServerTime: time.Now(),
|
||||
source: SOURCE_TCP,
|
||||
Timestamp: int64(timestamp * float64(time.Second)),
|
||||
Position: [3]float64{lat, lon, alt},
|
||||
Orientation: [3]float64{pitch, roll, yaw},
|
||||
//Timestamp: time.Unix(0, prep.Timestamp * int64(time.Millisecond)),
|
||||
}
|
||||
//log.Println(string(pretty.Pretty(jsonData)))
|
||||
//log.Println(sd)
|
||||
//logrus.Println(string(pretty.Pretty(jsonData)))
|
||||
//logrus.Println(sd)
|
||||
return sd, nil
|
||||
}
|
||||
|
||||
|
||||
func convertAndroidHyperImu(jsonData []byte) (*Sensordata, error) {
|
||||
func convertAndroidHyperImu(jsonData []byte) (*sensorData, error) {
|
||||
timestamp := gjson.Get(string(jsonData), "Timestamp").Int()
|
||||
lat := gjson.Get(string(jsonData), "GPS.0").Float()
|
||||
lon := gjson.Get(string(jsonData), "GPS.1").Float()
|
||||
@ -165,12 +152,13 @@ func convertAndroidHyperImu(jsonData []byte) (*Sensordata, error) {
|
||||
roll := gjson.Get(string(jsonData), "orientation.1").Float()
|
||||
yaw := gjson.Get(string(jsonData), "orientation.2").Float()
|
||||
|
||||
sd := &Sensordata{
|
||||
SourceId: SOURCE_TCP,
|
||||
Timestamp: timestamp * int64(time.Millisecond),
|
||||
//Timestamp: time.Unix(0, prep.Timestamp * int64(time.Millisecond)),
|
||||
Position: [3]float64{lat, lon, alt},
|
||||
sd := &sensorData{
|
||||
ServerTime: time.Now(),
|
||||
source: SOURCE_TCP,
|
||||
Timestamp: timestamp * int64(time.Millisecond),
|
||||
Position: [3]float64{lat, lon, alt},
|
||||
Orientation: [3]float64{pitch, roll, yaw},
|
||||
//Timestamp: time.Unix(0, prep.Timestamp * int64(time.Millisecond)),
|
||||
}
|
||||
return sd, nil
|
||||
}
|
||||
176
core/service.go
Normal file
176
core/service.go
Normal file
@ -0,0 +1,176 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OpMode uint8
|
||||
|
||||
const (
|
||||
STOPPED OpMode = iota
|
||||
LIVE
|
||||
RECORDING
|
||||
REPLAY
|
||||
)
|
||||
|
||||
type Service interface {
|
||||
AllTrackings() ([]TrackingMetadata, error)
|
||||
StartPipeline(cols ...CollectorType) (string, error)
|
||||
StartRecord() (string, error)
|
||||
StopRecord() (*TrackingMetadata, error)
|
||||
StopAll() (*TrackingMetadata, error)
|
||||
|
||||
LoadTracking(trackingId uuid.UUID)
|
||||
DeleteTracking(trackingId uuid.UUID)
|
||||
|
||||
StartReplay()
|
||||
PauseReplay()
|
||||
StopReplay()
|
||||
}
|
||||
|
||||
type trackingService struct {
|
||||
current *Tracking
|
||||
config *Configuration
|
||||
pipe *pipeline
|
||||
repo Repo
|
||||
opMode OpMode
|
||||
collectors []Collector
|
||||
}
|
||||
|
||||
func TrackingService(r Repo, d Publisher, c *Configuration) *trackingService {
|
||||
t := &Tracking{}
|
||||
ts := &trackingService{
|
||||
current: t,
|
||||
opMode: STOPPED,
|
||||
config: c,
|
||||
repo: r,
|
||||
pipe: NewPipeline(d, t, c),
|
||||
collectors: nil,
|
||||
}
|
||||
//ts.pipe.Run()
|
||||
return ts
|
||||
}
|
||||
|
||||
func (t *trackingService) StartPipeline(cols ...CollectorType) (string, error) {
|
||||
logrus.Info("SERVICE: NEW SETUP")
|
||||
if t.opMode == RECORDING {
|
||||
txt := "trackingservice: please stop recording before resetting pipeline"
|
||||
logrus.Warn(txt)
|
||||
return "RECORDING", errors.New(txt)
|
||||
}
|
||||
if t.opMode == LIVE {
|
||||
logrus.Warn("trackingservice: stop current running stream/record before creating new one")
|
||||
t.StopAll()
|
||||
//time.Sleep(1000 * time.Millisecond)
|
||||
}
|
||||
logrus.Debug("new tracking:", cols)
|
||||
t.opMode = LIVE
|
||||
t.collectors = nil
|
||||
for _, col := range cols {
|
||||
t.collectors = append(t.collectors, NewCollector(col, t.pipe, t.config))
|
||||
}
|
||||
t.safelyReplaceTracking(emptyTracking())
|
||||
t.current.Collectors = cols
|
||||
for _, e := range t.collectors {
|
||||
e.Collect()
|
||||
}
|
||||
t.pipe.Run()
|
||||
//time.Sleep(3 * time.Second)
|
||||
return "LIVE", nil
|
||||
}
|
||||
|
||||
func (t *trackingService) AllTrackings() ([]TrackingMetadata, error) {
|
||||
logrus.Info("SERVICE: GET ALL TRACKINGS")
|
||||
data, err := t.repo.LoadAll()
|
||||
return data, err
|
||||
}
|
||||
|
||||
func (t *trackingService) StartRecord() (string, error) {
|
||||
logrus.Info("SERVICE: START RECORD")
|
||||
if t.opMode != LIVE {
|
||||
if t.opMode == RECORDING {
|
||||
txt := "trackingservice: already recording"
|
||||
logrus.Warn(txt)
|
||||
return "record already running since: " + t.current.TimeCreated.String(), errors.New(txt)
|
||||
} else {
|
||||
txt := "trackingservice: start collector pipeline to record data"
|
||||
logrus.Warn(txt)
|
||||
return "record already running since: " + t.current.TimeCreated.String(), errors.New(txt)
|
||||
}
|
||||
}
|
||||
t.opMode = RECORDING
|
||||
t.current.TimeCreated = time.Now()
|
||||
t.pipe.Record()
|
||||
return "record started at: " + t.current.TimeCreated.String(), nil
|
||||
}
|
||||
|
||||
func (t *trackingService) StopRecord() (*TrackingMetadata, error) {
|
||||
logrus.Info("SERVICE: STOP RECORD")
|
||||
if t.opMode != RECORDING {
|
||||
txt := "trackingservice: couldn't stop. not recording"
|
||||
logrus.Info(txt)
|
||||
return nil, errors.New(txt)
|
||||
}
|
||||
t.pipe.StopRecord()
|
||||
mRec.Lock()
|
||||
mRaw.Lock()
|
||||
err := t.repo.Save(*t.current)
|
||||
mRaw.Unlock()
|
||||
mRec.Unlock()
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
t.opMode = LIVE
|
||||
//time.Sleep(20 * time.Millisecond)
|
||||
tm := t.current.TrackingMetadata
|
||||
t.safelyReplaceTracking(emptyTracking())
|
||||
t.current.Collectors = tm.Collectors
|
||||
return &tm, err
|
||||
}
|
||||
|
||||
func (t *trackingService) StopAll() (*TrackingMetadata, error) {
|
||||
logrus.Info("SERVICE: STOP ALL")
|
||||
var tm *TrackingMetadata = nil
|
||||
var err error
|
||||
t.pipe.Close()
|
||||
for _, e := range t.collectors {
|
||||
e.Close()
|
||||
}
|
||||
if t.opMode == RECORDING {
|
||||
logrus.Warn("trackingservice: stop recording gracefully")
|
||||
tm, err = t.StopRecord()
|
||||
}
|
||||
t.opMode = STOPPED
|
||||
return tm, err
|
||||
}
|
||||
|
||||
func (t *trackingService) LoadTracking(trackingId uuid.UUID) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *trackingService) DeleteTracking(trackingId uuid.UUID) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *trackingService) StartReplay() {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *trackingService) PauseReplay() {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *trackingService) StopReplay() {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *trackingService) safelyReplaceTracking(tr Tracking) {
|
||||
mRec.Lock()
|
||||
mRaw.Lock()
|
||||
*t.current = tr
|
||||
mRaw.Unlock()
|
||||
mRec.Unlock()
|
||||
}
|
||||
75
core/trackings.go
Normal file
75
core/trackings.go
Normal file
@ -0,0 +1,75 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Tracking struct {
|
||||
TrackingMetadata
|
||||
Records []recordPair
|
||||
Rawdata []rawRecord
|
||||
}
|
||||
|
||||
var mRec sync.RWMutex
|
||||
var mRaw sync.RWMutex
|
||||
|
||||
type TrackingMetadata struct {
|
||||
UUID uuid.UUID
|
||||
TimeCreated time.Time
|
||||
Collectors []CollectorType
|
||||
}
|
||||
|
||||
// persistence wrapper for sensordata
|
||||
type recordPair struct {
|
||||
RecordTimeKey time.Time // uniqueness ensured through mutex
|
||||
DataPair map[sourceId]sensorData
|
||||
}
|
||||
|
||||
type rawRecord struct {
|
||||
RecordTimeKey time.Time // uniqueness ensured through mutex
|
||||
Data sensorData
|
||||
}
|
||||
|
||||
// END persistence wrapper for sensordata
|
||||
|
||||
func (s *Tracking) EnqueuePair(tcp sensorData, ser sensorData) {
|
||||
rp := recordPair{
|
||||
RecordTimeKey: time.Now(),
|
||||
DataPair: map[sourceId]sensorData{
|
||||
tcp.source: tcp,
|
||||
ser.source: ser,
|
||||
},
|
||||
}
|
||||
mRec.Lock()
|
||||
s.Records = append(s.Records, rp)
|
||||
logrus.Debugln("tracking Records: len->", len(s.Records))
|
||||
mRec.Unlock()
|
||||
}
|
||||
|
||||
func (s *Tracking) EnqueueRaw(data sensorData) {
|
||||
sr := rawRecord{
|
||||
time.Now(),
|
||||
data,
|
||||
}
|
||||
mRec.Lock()
|
||||
s.Rawdata = append(s.Rawdata, sr)
|
||||
logrus.Debugln("raw data points: len->", len(s.Rawdata))
|
||||
mRec.Unlock()
|
||||
}
|
||||
|
||||
func emptyTracking() Tracking {
|
||||
return Tracking{
|
||||
TrackingMetadata: TrackingMetadata{
|
||||
UUID: uuid.New(),
|
||||
},
|
||||
Records: []recordPair{},
|
||||
Rawdata: []rawRecord{},
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Tracking) isEmpty() bool {
|
||||
return len(s.Rawdata)+len(s.Records) == 0
|
||||
}
|
||||
32
example_config.yml
Normal file
32
example_config.yml
Normal file
@ -0,0 +1,32 @@
|
||||
# !!! copy this file and rename it to gpsconfig.yml !!!
|
||||
# !!! file must be located in working directory !!!
|
||||
|
||||
# server configurations
|
||||
webserver:
|
||||
port: ":3011"
|
||||
|
||||
# collector configurations
|
||||
collectors:
|
||||
porttcp: ":3010"
|
||||
portserial: "/dev/tty.usbmodem14201"
|
||||
|
||||
# processing pipeline configurations
|
||||
pipeline:
|
||||
publishIntervalMs: 50
|
||||
syncUpdateIntervalMs: 494
|
||||
|
||||
debuglevel: "INFO"
|
||||
|
||||
#// ErrorLevel level. Logs. Used for errors that should definitely be noted.
|
||||
#// Commonly used for hooks to send errors to an error tracking service.
|
||||
#ErrorLevel
|
||||
|
||||
#// WarnLevel level. Non-critical entries that deserve eyes.
|
||||
#WarnLevel
|
||||
|
||||
#// InfoLevel level. General operational entries about what's going on inside the
|
||||
#// application.
|
||||
#InfoLevel
|
||||
|
||||
#// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
|
||||
#DebugLevel
|
||||
13
go.mod
13
go.mod
@ -3,10 +3,17 @@ module git.timovolkmann.de/gyrogpsc
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/m7shapan/njson v1.0.1
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2
|
||||
github.com/gofiber/fiber/v2 v2.2.4
|
||||
github.com/gofiber/template v1.6.6
|
||||
github.com/gofiber/websocket/v2 v2.0.2
|
||||
github.com/google/go-cmp v0.4.0
|
||||
github.com/google/uuid v1.1.2
|
||||
github.com/sirupsen/logrus v1.6.0
|
||||
github.com/spf13/viper v1.7.1
|
||||
github.com/tidwall/gjson v1.6.0
|
||||
github.com/tidwall/pretty v1.0.2
|
||||
go.bug.st/serial v1.1.1
|
||||
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf // indirect
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
|
||||
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f // indirect
|
||||
)
|
||||
|
||||
568
go.sum
568
go.sum
@ -1,18 +1,355 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v3 v3.0.1/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||
github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM=
|
||||
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||
github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
|
||||
github.com/Joker/hpp v0.0.0-20180418125244-6893e659854a/go.mod h1:MzD2WMdSxvbHw5fM/OXOFily/lipJWRc9C1px0Mt0ZE=
|
||||
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
|
||||
github.com/Joker/jade v1.0.0/go.mod h1:efZIdO0py/LtcJRSa/j2WEklMSAw84WV0zZVMxNToB8=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4=
|
||||
github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
|
||||
github.com/cbroglie/mustache v1.2.0/go.mod h1:gomHsVlF4zTcsY2H8d7U9SipCYbbrAks5breARbqAM0=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/creack/goselect v0.1.1 h1:tiSSgKE1eJtxs1h/VgGQWuXUP0YS4CDIFMp6vaI1ls0=
|
||||
github.com/creack/goselect v0.1.1/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/denis-tingajkin/go-header v0.3.1/go.mod h1:sq/2IxMhaZX+RRcgHfCRx/m0M5na0fBt4/CRe7Lrji0=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE=
|
||||
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA=
|
||||
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
|
||||
github.com/fasthttp/websocket v1.4.3 h1:qjhRJ/rTy4KB8oBxljEC00SDt6HUY9jLRfM601SUdS4=
|
||||
github.com/fasthttp/websocket v1.4.3/go.mod h1:5r4oKssgS7W6Zn6mPWap3NWzNPJNzUUh3baWTOhcYQk=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/flosch/pongo2/v4 v4.0.1/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-critic/go-critic v0.5.0/go.mod h1:4jeRh3ZAVnRYhuWdOEvwzVqLUpxMSoAT0xZ74JsTPlo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
|
||||
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
|
||||
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
|
||||
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
|
||||
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
|
||||
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
|
||||
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
|
||||
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
|
||||
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
|
||||
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
|
||||
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
|
||||
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
|
||||
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
|
||||
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
|
||||
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
|
||||
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
|
||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
|
||||
github.com/gofiber/fiber/v2 v2.1.0/go.mod h1:aG+lMkwy3LyVit4CnmYUbUdgjpc3UYOltvlJZ78rgQ0=
|
||||
github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE=
|
||||
github.com/gofiber/fiber/v2 v2.2.4 h1:t2V2SxlbQGdt8+SS/Mo+tQB0pDQn7OajKdA72qHcBVw=
|
||||
github.com/gofiber/fiber/v2 v2.2.4/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE=
|
||||
github.com/gofiber/template v1.6.6 h1:mZ0sMRomxndpzVOSez6jKPaMO9UlUDfmBfHFmkFnb/A=
|
||||
github.com/gofiber/template v1.6.6/go.mod h1:WmzkzTh6QWwrGysWFU8bwNsmHmqRbxHmWZcApIT1ORo=
|
||||
github.com/gofiber/websocket/v2 v2.0.2 h1:UA/6NpyG+vmPGlvJvW8MJPJpRFuS7abinZ5HbLuV8u0=
|
||||
github.com/gofiber/websocket/v2 v2.0.2/go.mod h1:7VBnzEVRK0K0eTIVc5GbXPF1JWUFnllY0X4cRtG2v78=
|
||||
github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
|
||||
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
|
||||
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
|
||||
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
|
||||
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
|
||||
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
|
||||
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
|
||||
github.com/golangci/golangci-lint v1.28.3/go.mod h1:JlLqleIwwgLVJtjKtrB37OKp3LGLrUhEx9tWY4VKWSY=
|
||||
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
|
||||
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
|
||||
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
|
||||
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
|
||||
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
|
||||
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
|
||||
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/m7shapan/njson v1.0.1 h1:s+odQrPkzcCCGRTp46cD0XCVYN3pvdoaVwbFVmjAvys=
|
||||
github.com/m7shapan/njson v1.0.1/go.mod h1:4sidL3oRZO1KV5FkclRBPI7nqFzlIq3BwdxHRMlOa9U=
|
||||
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
|
||||
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
|
||||
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
|
||||
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
|
||||
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg=
|
||||
github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kyoh86/exportloopref v0.1.4/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
|
||||
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-slim v0.0.0-20200618151855-bde33eecb5ee/go.mod h1:ma9TUJeni8LGZMJvOwbAv/FOwiwqIMQN570LnpqCBSM=
|
||||
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
|
||||
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nishanths/exhaustive v0.0.0-20200525081945-8e46705b6132/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
|
||||
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
|
||||
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
|
||||
github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/savsgio/gotils v0.0.0-20200608150037-a5f6f5aef16c h1:2nF5+FZ4/qp7pZVL7fR6DEaSTzuDmNaFTyqp92/hwF8=
|
||||
github.com/savsgio/gotils v0.0.0-20200608150037-a5f6f5aef16c/go.mod h1:TWNAOTaVzGOXq8RbEvHnhzA/A2sLZzgn0m6URjnukY8=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
|
||||
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
|
||||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
|
||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI=
|
||||
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
|
||||
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
|
||||
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
|
||||
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
|
||||
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
|
||||
github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc=
|
||||
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
|
||||
@ -20,14 +357,237 @@ github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
|
||||
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
|
||||
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
|
||||
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.12.0/go.mod h1:229t1eWu9UXTPmoUkbpN/fctKPBY4IJoFXQnxHGXy6E=
|
||||
github.com/valyala/fasthttp v1.14.0/go.mod h1:ol1PCaL0dX20wC0htZ7sYCsvCYmrouYra0zHzaclZhE=
|
||||
github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA=
|
||||
github.com/valyala/fasthttp v1.17.0 h1:P8/koH4aSnJ4xbd0cUUFEGQs3jQqIxoDDyRQrUiAkqg=
|
||||
github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A=
|
||||
github.com/valyala/quicktemplate v1.5.0/go.mod h1:v7yYWpBEiutDyNfVaph6oC/yKwejzVyTX/2cwwHxyok=
|
||||
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=
|
||||
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.bug.st/serial v1.1.1 h1:5J1DpaIaSIruBi7jVnKXnhRS+YQ9+2PLJMtIZKoIgnc=
|
||||
go.bug.st/serial v1.1.1/go.mod h1:VmYBeyJWp5BnJ0tw2NUJHZdJTGl2ecBGABHlzRK1knY=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0 h1:5kGOVHlq0euqwzgTC9Vu15p6fV1Wi0ArVi8da2urnVg=
|
||||
golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf h1:kt3wY1Lu5MJAnKTfoMR52Cu4gwvna4VTzNOiT8tY73s=
|
||||
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0=
|
||||
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200428185508-e9a00ec82136/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200702044944-0cc1aa72b347/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
|
||||
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
mvdan.cc/gofumpt v0.0.0-20200513141252-abc0db2c416a/go.mod h1:4q/PlrZKQLU5MowSvCKM3U4xJUPtJ8vKWx7vsWFJ3MI=
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||
|
||||
@ -22,7 +22,7 @@ window.addEventListener("load", function(evt) {
|
||||
print("Websocket already open")
|
||||
return false;
|
||||
}
|
||||
ws = new WebSocket("ws://localhost:3011/echo");
|
||||
ws = new WebSocket("ws://localhost:3011/ws");
|
||||
ws.onopen = function(evt) {
|
||||
print("OPEN");
|
||||
}
|
||||
|
||||
165
storage/kvstore.go
Normal file
165
storage/kvstore.go
Normal file
@ -0,0 +1,165 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
"github.com/dgraph-io/badger/v2"
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/pretty"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Must implement Repo
|
||||
type badgerStore struct {
|
||||
trackingsDb *badger.DB
|
||||
recordsDb *badger.DB
|
||||
rawdataDb *badger.DB
|
||||
}
|
||||
|
||||
func NewRepository(c *core.Configuration) *badgerStore {
|
||||
dir, _ := os.Getwd()
|
||||
logrus.Debug(dir)
|
||||
if _, err := os.Stat(filepath.Join(dir, "_db")); os.IsNotExist(err) {
|
||||
os.Mkdir(filepath.Join(dir, "_db"), os.ModePerm)
|
||||
}
|
||||
|
||||
tr, err := badger.Open(badger.DefaultOptions("_db/trackings"))
|
||||
dp, err := badger.Open(badger.DefaultOptions("_db/records"))
|
||||
rd, err := badger.Open(badger.DefaultOptions("_db/raw"))
|
||||
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
return &badgerStore{trackingsDb: tr, recordsDb: dp, rawdataDb: rd}
|
||||
}
|
||||
|
||||
func (r *badgerStore) isDbAvailable() bool {
|
||||
return r.trackingsDb.IsClosed() || r.recordsDb.IsClosed() || r.rawdataDb.IsClosed()
|
||||
}
|
||||
|
||||
func (r *badgerStore) Save(tr core.Tracking) error {
|
||||
if ok := r.isDbAvailable(); ok {
|
||||
logrus.Error("unable to write to database. database closed!")
|
||||
return badger.ErrDBClosed
|
||||
}
|
||||
ts, err := tr.TimeCreated.MarshalText()
|
||||
if err != nil {
|
||||
logrus.Error(err, tr)
|
||||
}
|
||||
logrus.Info("save tracking:", tr.TimeCreated)
|
||||
meta, err := json.Marshal(tr.TrackingMetadata)
|
||||
if err != nil {
|
||||
logrus.Error(err, tr)
|
||||
return err
|
||||
}
|
||||
err = r.recordsDb.Update(func(txn *badger.Txn) error {
|
||||
for _, v := range tr.Records {
|
||||
k := createRecordKey(tr.UUID, v.RecordTimeKey.UnixNano())
|
||||
j, err := json.Marshal(v.DataPair)
|
||||
logrus.Debugln("save record k/v:\n", tr.UUID.String(), strconv.FormatInt(v.RecordTimeKey.UnixNano(), 10))
|
||||
logrus.Debugln(string(pretty.Pretty(j)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
txn.Set(k, j)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
logrus.Error(err, tr)
|
||||
return err
|
||||
}
|
||||
err = r.rawdataDb.Update(func(txn *badger.Txn) error {
|
||||
for _, v := range tr.Rawdata {
|
||||
k := createRecordKey(tr.UUID, v.RecordTimeKey.UnixNano())
|
||||
j, err := json.Marshal(v)
|
||||
logrus.Debugln("save raw k/v:\n", tr.UUID.String(), strconv.FormatInt(v.RecordTimeKey.UnixNano(), 10))
|
||||
logrus.Debugln(string(pretty.Pretty(j)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
txn.Set(k, j)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
logrus.Error(err, tr)
|
||||
return err
|
||||
}
|
||||
err = r.trackingsDb.Update(func(txn *badger.Txn) error {
|
||||
logrus.Debug("save tracking meta k/v:\n", string(ts), string(meta))
|
||||
err := txn.Set(ts, meta)
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
logrus.Error(err, tr)
|
||||
return err
|
||||
}
|
||||
|
||||
dr := 0.5
|
||||
err = r.trackingsDb.RunValueLogGC(dr)
|
||||
logrus.Debug("DB GC:", err)
|
||||
err = r.recordsDb.RunValueLogGC(dr)
|
||||
logrus.Debug("DB GC:", err)
|
||||
err = r.rawdataDb.RunValueLogGC(dr)
|
||||
logrus.Debug("DB GC:", err)
|
||||
logrus.Info("sucessfully saved tracking")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *badgerStore) LoadAll() ([]core.TrackingMetadata, error) {
|
||||
var result []core.TrackingMetadata
|
||||
err := r.trackingsDb.View(func(txn *badger.Txn) error {
|
||||
opts := badger.DefaultIteratorOptions
|
||||
it := txn.NewIterator(opts)
|
||||
defer it.Close()
|
||||
for it.Rewind(); it.Valid(); it.Next() {
|
||||
item := it.Item()
|
||||
el := core.TrackingMetadata{}
|
||||
item.Value(func(val []byte) error {
|
||||
logrus.Debugln(string(val))
|
||||
err := json.Unmarshal(val, &el)
|
||||
return err
|
||||
})
|
||||
result = append(result, el)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (r *badgerStore) Load(id uuid.UUID) (core.Tracking, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func createRecordKey(uid uuid.UUID, timestamp int64) []byte {
|
||||
prefix, err := uid.MarshalText()
|
||||
if err != nil || timestamp < 0 {
|
||||
logrus.Error("unable to create key", err)
|
||||
}
|
||||
suffix := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(suffix, uint64(timestamp))
|
||||
|
||||
return append(prefix, suffix...)
|
||||
}
|
||||
|
||||
func unmarshalDataKey(key []byte) (uuid.UUID, int64) {
|
||||
if len(key) != 24 {
|
||||
panic("corrupted key")
|
||||
}
|
||||
prefix := key[0:15]
|
||||
suffix := key[15:24]
|
||||
uid, err := uuid.FromBytes(prefix)
|
||||
if err != nil {
|
||||
panic("corrupted key")
|
||||
}
|
||||
timestamp := int64(binary.BigEndian.Uint64(suffix))
|
||||
return uid, timestamp
|
||||
}
|
||||
216
ublox/decode.go
216
ublox/decode.go
@ -6,152 +6,152 @@
|
||||
package ublox
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"bufio"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
// A decoder scans an io stream into UBX (0xB5-0x62 separated) or NMEA ("$xxx,,,,*FF\r\n") frames.
|
||||
// If you have an unmixed stream of NMEA-only data you can use nmea.Decode() on bufio.Scanner.Bytes() directly.
|
||||
type decoder struct {
|
||||
s *bufio.Scanner
|
||||
s *bufio.Scanner
|
||||
}
|
||||
|
||||
// NewDecoder creates a new bufio Scanner with a splitfunc that can handle both UBX and NMEA frames.
|
||||
func NewDecoder(r io.Reader) *decoder {
|
||||
d := bufio.NewScanner(r)
|
||||
d.Split(splitFunc)
|
||||
return &decoder{s: d}
|
||||
d := bufio.NewScanner(r)
|
||||
d.Split(splitFunc)
|
||||
return &decoder{s: d}
|
||||
}
|
||||
|
||||
// Assume we're either at the start of an NMEA sentence or at the start of a UBX message
|
||||
// if not, skip to the first $ or UBX SOM.
|
||||
func splitFunc(data []byte, atEOF bool) (advance int, token []byte, err error) {
|
||||
if len(data) == 0 {
|
||||
return 0, nil, nil
|
||||
}
|
||||
if len(data) == 0 {
|
||||
return 0, nil, nil
|
||||
}
|
||||
|
||||
switch data[0] {
|
||||
case '$':
|
||||
return bufio.ScanLines(data, atEOF)
|
||||
switch data[0] {
|
||||
case '$':
|
||||
return bufio.ScanLines(data, atEOF)
|
||||
|
||||
case 0xB5:
|
||||
if len(data) < 8 {
|
||||
if atEOF {
|
||||
return len(data), nil, io.ErrUnexpectedEOF
|
||||
}
|
||||
return 0, nil, nil
|
||||
}
|
||||
case 0xB5:
|
||||
if len(data) < 8 {
|
||||
if atEOF {
|
||||
return len(data), nil, io.ErrUnexpectedEOF
|
||||
}
|
||||
return 0, nil, nil
|
||||
}
|
||||
|
||||
sz := 8 + int(data[4]) + int(data[5])*256
|
||||
if data[1] == 0x62 {
|
||||
if sz <= len(data) {
|
||||
return sz, data[:sz], nil
|
||||
}
|
||||
if sz <= bufio.MaxScanTokenSize {
|
||||
return 0, nil, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
sz := 8 + int(data[4]) + int(data[5])*256
|
||||
if data[1] == 0x62 {
|
||||
if sz <= len(data) {
|
||||
return sz, data[:sz], nil
|
||||
}
|
||||
if sz <= bufio.MaxScanTokenSize {
|
||||
return 0, nil, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// resync to SOM or $
|
||||
data = data[1:]
|
||||
i1 := bytes.IndexByte(data, '$')
|
||||
if i1 < 0 {
|
||||
i1 = len(data)
|
||||
}
|
||||
// resync to SOM or $
|
||||
data = data[1:]
|
||||
i1 := bytes.IndexByte(data, '$')
|
||||
if i1 < 0 {
|
||||
i1 = len(data)
|
||||
}
|
||||
|
||||
i2 := bytes.IndexByte(data, 0xB5)
|
||||
if i2 < 0 {
|
||||
i2 = len(data)
|
||||
}
|
||||
if i1 > i2 {
|
||||
i1 = i2
|
||||
}
|
||||
return 1 + i1, nil, nil
|
||||
i2 := bytes.IndexByte(data, 0xB5)
|
||||
if i2 < 0 {
|
||||
i2 = len(data)
|
||||
}
|
||||
if i1 > i2 {
|
||||
i1 = i2
|
||||
}
|
||||
return 1 + i1, nil, nil
|
||||
}
|
||||
|
||||
// Decode reads on NMEA or UBX frame and calls decodeUbx accordingly to parse the message, while skipping NMEA.
|
||||
func (d *decoder) Decode() (msg interface{}, err error) {
|
||||
if !d.s.Scan() {
|
||||
if err = d.s.Err(); err == nil {
|
||||
err = io.EOF
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
if !d.s.Scan() {
|
||||
if err = d.s.Err(); err == nil {
|
||||
err = io.EOF
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch d.s.Bytes()[0] {
|
||||
case '$':
|
||||
return nil, errors.New("NMEA not implemented")
|
||||
//return nmea.Decode(d.s.Bytes())
|
||||
case 0xB5:
|
||||
return decodeUbx(d.s.Bytes())
|
||||
}
|
||||
panic("impossible frame")
|
||||
switch d.s.Bytes()[0] {
|
||||
case '$':
|
||||
return nil, errors.New("NMEA not implemented")
|
||||
//return nmea.Decode(d.s.Bytes())
|
||||
case 0xB5:
|
||||
return decodeUbx(d.s.Bytes())
|
||||
}
|
||||
panic("impossible frame")
|
||||
}
|
||||
|
||||
var (
|
||||
errInvalidFrame = errors.New("invalid UBX frame")
|
||||
errInvalidChkSum = errors.New("invalid UBX checksum")
|
||||
errInvalidFrame = errors.New("invalid UBX frame")
|
||||
errInvalidChkSum = errors.New("invalid UBX checksum")
|
||||
)
|
||||
|
||||
func decodeUbx(frame []byte) (msg Message, err error) {
|
||||
|
||||
buf := bytes.NewReader(frame)
|
||||
buf := bytes.NewReader(frame)
|
||||
|
||||
var header struct {
|
||||
Preamble uint16
|
||||
ClassID uint16
|
||||
Length uint16
|
||||
}
|
||||
var header struct {
|
||||
Preamble uint16
|
||||
ClassID uint16
|
||||
Length uint16
|
||||
}
|
||||
|
||||
if err := binary.Read(buf, binary.LittleEndian, &header); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := binary.Read(buf, binary.LittleEndian, &header); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if header.Preamble != 0x62B5 {
|
||||
return nil, errInvalidFrame
|
||||
}
|
||||
if header.Preamble != 0x62B5 {
|
||||
return nil, errInvalidFrame
|
||||
}
|
||||
|
||||
if buf.Len()+2 < int(header.Length) {
|
||||
return nil, io.ErrShortBuffer
|
||||
}
|
||||
if buf.Len()+2 < int(header.Length) {
|
||||
return nil, io.ErrShortBuffer
|
||||
}
|
||||
|
||||
var a, b byte
|
||||
for _, v := range frame[2 : header.Length+6] {
|
||||
a += byte(v)
|
||||
b += a
|
||||
}
|
||||
var a, b byte
|
||||
for _, v := range frame[2 : header.Length+6] {
|
||||
a += byte(v)
|
||||
b += a
|
||||
}
|
||||
|
||||
if frame[header.Length+6] != a || frame[header.Length+7] != b {
|
||||
return nil, errInvalidChkSum
|
||||
}
|
||||
if frame[header.Length+6] != a || frame[header.Length+7] != b {
|
||||
return nil, errInvalidChkSum
|
||||
}
|
||||
|
||||
switch header.ClassID {
|
||||
case 0x0105: // ACK-ACK
|
||||
fmt.Println("ACK-ACK not implemented")
|
||||
//msg = &AckAck{}
|
||||
case 0x0005: // ACK-NAK
|
||||
fmt.Println("ACK-NAK not implemented")
|
||||
//msg = &AckNak{}
|
||||
case 0x0701: // NAV-PVT
|
||||
msg = &NavPvt{}
|
||||
case 0x0028: // HNR-PVT
|
||||
msg = &HnrPvt{}
|
||||
case 0x0501: // NAV-ATT
|
||||
msg = &NavAtt{}
|
||||
default:
|
||||
}
|
||||
if msg != nil {
|
||||
err = binary.Read(buf, binary.LittleEndian, msg)
|
||||
} else {
|
||||
msg = &RawMessage{classID: header.ClassID, Data: append([]byte(nil), frame[6:len(frame)-2]...)}
|
||||
}
|
||||
//fmt.Println(msg)
|
||||
switch header.ClassID {
|
||||
case 0x0105: // ACK-ACK
|
||||
fmt.Println("ACK-ACK not implemented")
|
||||
//msg = &AckAck{}
|
||||
case 0x0005: // ACK-NAK
|
||||
fmt.Println("ACK-NAK not implemented")
|
||||
//msg = &AckNak{}
|
||||
case 0x0701: // NAV-PVT
|
||||
msg = &NavPvt{}
|
||||
case 0x0028: // HNR-PVT
|
||||
msg = &HnrPvt{}
|
||||
case 0x0501: // NAV-ATT
|
||||
msg = &NavAtt{}
|
||||
default:
|
||||
}
|
||||
if msg != nil {
|
||||
err = binary.Read(buf, binary.LittleEndian, msg)
|
||||
} else {
|
||||
msg = &RawMessage{classID: header.ClassID, Data: append([]byte(nil), frame[6:len(frame)-2]...)}
|
||||
}
|
||||
//fmt.Println(msg)
|
||||
|
||||
return msg, err
|
||||
return msg, err
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package ublox
|
||||
|
||||
type Message interface {
|
||||
ClassID() uint16
|
||||
ClassID() uint16
|
||||
}
|
||||
|
||||
//type UbxMessage interface {
|
||||
@ -11,90 +11,90 @@ type Message interface {
|
||||
//}
|
||||
|
||||
type RawMessage struct {
|
||||
classID uint16
|
||||
Data []byte
|
||||
classID uint16
|
||||
Data []byte
|
||||
}
|
||||
|
||||
func (msg *RawMessage) ClassID() uint16 { return msg.classID }
|
||||
|
||||
type NavPvt struct {
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Year_y uint16 // - Year (UTC)
|
||||
Month_month byte // - Month, range 1..12 (UTC)
|
||||
Day_d byte // - Day of month, range 1..31 (UTC)
|
||||
Hour_h byte // - Hour of day, range 0..23 (UTC)
|
||||
Min_min byte // - Minute of hour, range 0..59 (UTC)
|
||||
Sec_s byte // - Seconds of minute, range 0..60 (UTC)
|
||||
Valid NavPVTValid // - Validity flags (see graphic below)
|
||||
TAcc_ns uint32 // - Time accuracy estimate (UTC)
|
||||
Nano_ns int32 // - Fraction of second, range -1e9 .. 1e9 (UTC)
|
||||
FixType NavPVTFixType // - GNSSfix Type
|
||||
Flags NavPVTFlags // - Fix status flags (see graphic below)
|
||||
Flags2 NavPVTFlags2 // - Additional flags (see graphic below)
|
||||
NumSV byte // - Number of satellites used in Nav Solution
|
||||
Lon_dege7 int32 // 1e-7 Longitude
|
||||
Lat_dege7 int32 // 1e-7 Latitude
|
||||
Height_mm int32 // - Height above ellipsoid
|
||||
HMSL_mm int32 // - Height above mean sea level
|
||||
HAcc_mm uint32 // - Horizontal accuracy estimate
|
||||
VAcc_mm uint32 // - Vertical accuracy estimate
|
||||
VelN_mm_s int32 // - NED north velocity
|
||||
VelE_mm_s int32 // - NED east velocity
|
||||
VelD_mm_s int32 // - NED down velocity
|
||||
GSpeed_mm_s int32 // - Ground Speed (2-D)
|
||||
HeadMot_dege5 int32 // 1e-5 Heading of motion (2-D)
|
||||
SAcc_mm_s uint32 // - Speed accuracy estimate
|
||||
HeadAcc_dege5 uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
PDOPe2 uint16 // 0.01 Position DOP
|
||||
Flags3 NavPVTFlags3 // - Additional flags (see graphic below)
|
||||
Reserved1 [5]byte // - Reserved
|
||||
HeadVeh_dege5 int32 // 1e-5 Heading of vehicle (2-D), this is only valid when headVehValid is set, otherwise the output is set to the heading of motion
|
||||
MagDec_dege2 int16 // 1e-2 Magnetic declination. Only supported in ADR 4.10 and later.
|
||||
MagAcc_deg2e uint16 // 1e-2 Magnetic declination accuracy. Only supported in ADR 4.10 and later.
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Year_y uint16 // - Year (UTC)
|
||||
Month_month byte // - Month, range 1..12 (UTC)
|
||||
Day_d byte // - Day of month, range 1..31 (UTC)
|
||||
Hour_h byte // - Hour of day, range 0..23 (UTC)
|
||||
Min_min byte // - Minute of hour, range 0..59 (UTC)
|
||||
Sec_s byte // - Seconds of minute, range 0..60 (UTC)
|
||||
Valid NavPVTValid // - Validity flags (see graphic below)
|
||||
TAcc_ns uint32 // - Time accuracy estimate (UTC)
|
||||
Nano_ns int32 // - Fraction of second, range -1e9 .. 1e9 (UTC)
|
||||
FixType NavPVTFixType // - GNSSfix Type
|
||||
Flags NavPVTFlags // - Fix status flags (see graphic below)
|
||||
Flags2 NavPVTFlags2 // - Additional flags (see graphic below)
|
||||
NumSV byte // - Number of satellites used in Nav Solution
|
||||
Lon_dege7 int32 // 1e-7 Longitude
|
||||
Lat_dege7 int32 // 1e-7 Latitude
|
||||
Height_mm int32 // - Height above ellipsoid
|
||||
HMSL_mm int32 // - Height above mean sea level
|
||||
HAcc_mm uint32 // - Horizontal accuracy estimate
|
||||
VAcc_mm uint32 // - Vertical accuracy estimate
|
||||
VelN_mm_s int32 // - NED north velocity
|
||||
VelE_mm_s int32 // - NED east velocity
|
||||
VelD_mm_s int32 // - NED down velocity
|
||||
GSpeed_mm_s int32 // - Ground Speed (2-D)
|
||||
HeadMot_dege5 int32 // 1e-5 Heading of motion (2-D)
|
||||
SAcc_mm_s uint32 // - Speed accuracy estimate
|
||||
HeadAcc_dege5 uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
PDOPe2 uint16 // 0.01 Position DOP
|
||||
Flags3 NavPVTFlags3 // - Additional flags (see graphic below)
|
||||
Reserved1 [5]byte // - Reserved
|
||||
HeadVeh_dege5 int32 // 1e-5 Heading of vehicle (2-D), this is only valid when headVehValid is set, otherwise the output is set to the heading of motion
|
||||
MagDec_dege2 int16 // 1e-2 Magnetic declination. Only supported in ADR 4.10 and later.
|
||||
MagAcc_deg2e uint16 // 1e-2 Magnetic declination accuracy. Only supported in ADR 4.10 and later.
|
||||
}
|
||||
|
||||
func (NavPvt) ClassID() uint16 { return 0x0701 }
|
||||
|
||||
type HnrPvt struct {
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Year_y uint16 // - Year (UTC)
|
||||
Month_month byte // - Month, range 1..12 (UTC)
|
||||
Day_d byte // - Day of month, range 1..31 (UTC)
|
||||
Hour_h byte // - Hour of day, range 0..23 (UTC)
|
||||
Min_min byte // - Minute of hour, range 0..59 (UTC)
|
||||
Sec_s byte // - Seconds of minute, range 0..60 (UTC)
|
||||
Valid byte // - Validity flags (see graphic below)
|
||||
Nano_ns int32 // - Fraction of second, range -1e9 .. 1e9 (UTC)
|
||||
FixType byte // - GNSSfix Type
|
||||
Flags byte // - Fix status flags (see graphic below)
|
||||
Reserved [2]byte
|
||||
Lon_dege7 int32 // 1e-7 Longitude
|
||||
Lat_dege7 int32 // 1e-7 Latitude
|
||||
Height_mm int32 // - Height above ellipsoid
|
||||
HMSL_mm int32 // - Height above mean sea level
|
||||
GSpeed_mm_s int32 // - Ground Speed (2-D)
|
||||
Speed_mm_s int32 // Speed (3-D)
|
||||
HeadMot_dege5 int32 // 1e-5 Heading of motion (2-D)
|
||||
HeadVeh_dege5 int32 // 1e-5 Heading of vehicle (2-D), this is only valid when headVehValid is set, otherwise the output is set to the heading of motion
|
||||
HAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
VAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
SAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
HeadAcc_dege5 uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
Reserved1 [4]byte // - Reserved
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Year_y uint16 // - Year (UTC)
|
||||
Month_month byte // - Month, range 1..12 (UTC)
|
||||
Day_d byte // - Day of month, range 1..31 (UTC)
|
||||
Hour_h byte // - Hour of day, range 0..23 (UTC)
|
||||
Min_min byte // - Minute of hour, range 0..59 (UTC)
|
||||
Sec_s byte // - Seconds of minute, range 0..60 (UTC)
|
||||
Valid byte // - Validity flags (see graphic below)
|
||||
Nano_ns int32 // - Fraction of second, range -1e9 .. 1e9 (UTC)
|
||||
FixType byte // - GNSSfix Type
|
||||
Flags byte // - Fix status flags (see graphic below)
|
||||
Reserved [2]byte
|
||||
Lon_dege7 int32 // 1e-7 Longitude
|
||||
Lat_dege7 int32 // 1e-7 Latitude
|
||||
Height_mm int32 // - Height above ellipsoid
|
||||
HMSL_mm int32 // - Height above mean sea level
|
||||
GSpeed_mm_s int32 // - Ground Speed (2-D)
|
||||
Speed_mm_s int32 // Speed (3-D)
|
||||
HeadMot_dege5 int32 // 1e-5 Heading of motion (2-D)
|
||||
HeadVeh_dege5 int32 // 1e-5 Heading of vehicle (2-D), this is only valid when headVehValid is set, otherwise the output is set to the heading of motion
|
||||
HAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
VAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
SAcc uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
HeadAcc_dege5 uint32 // 1e-5 Heading accuracy estimate (both motion and vehicle)
|
||||
Reserved1 [4]byte // - Reserved
|
||||
}
|
||||
|
||||
func (HnrPvt) ClassID() uint16 { return 0x0028 }
|
||||
|
||||
type NavAtt struct {
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Version byte
|
||||
Reserved1 [3]byte
|
||||
Roll_deg int32
|
||||
Pitch_deg int32
|
||||
Heading_deg int32
|
||||
AccRoll_deg uint32
|
||||
AccPitch_deg uint32
|
||||
AccHeading_deg uint32
|
||||
ITOW_ms uint32 // - GPS time of week of the navigation epoch. See the description of iTOW for details.
|
||||
Version byte
|
||||
Reserved1 [3]byte
|
||||
Roll_deg int32
|
||||
Pitch_deg int32
|
||||
Heading_deg int32
|
||||
AccRoll_deg uint32
|
||||
AccPitch_deg uint32
|
||||
AccHeading_deg uint32
|
||||
}
|
||||
|
||||
func (NavAtt) ClassID() uint16 { return 0x0501 }
|
||||
@ -104,43 +104,43 @@ func (NavAtt) ClassID() uint16 { return 0x0501 }
|
||||
type NavPVTFixType byte
|
||||
|
||||
const (
|
||||
NavPVTNoFix NavPVTFixType = iota
|
||||
NavPVTDeadReckoning
|
||||
NavPVTFix2D
|
||||
NavPVTFix3D
|
||||
NavPVTGNSS
|
||||
NavPVTTimeOnly
|
||||
NavPVTNoFix NavPVTFixType = iota
|
||||
NavPVTDeadReckoning
|
||||
NavPVTFix2D
|
||||
NavPVTFix3D
|
||||
NavPVTGNSS
|
||||
NavPVTTimeOnly
|
||||
)
|
||||
|
||||
type NavPVTValid byte
|
||||
|
||||
const (
|
||||
NavPVTValidDate NavPVTValid = (1 << iota) // valid UTC Date (see Time Validity section for details)
|
||||
NavPVTValidTime // valid UTC time of day (see Time Validity section for details)
|
||||
NavPVTFullyResolved // UTC time of day has been fully resolved (no seconds uncertainty). Cannot be used to check if time is completely solved.
|
||||
NavPVTValidMag // valid magnetic declination
|
||||
NavPVTValidDate NavPVTValid = (1 << iota) // valid UTC Date (see Time Validity section for details)
|
||||
NavPVTValidTime // valid UTC time of day (see Time Validity section for details)
|
||||
NavPVTFullyResolved // UTC time of day has been fully resolved (no seconds uncertainty). Cannot be used to check if time is completely solved.
|
||||
NavPVTValidMag // valid magnetic declination
|
||||
)
|
||||
|
||||
type NavPVTFlags byte
|
||||
|
||||
const (
|
||||
NavPVTGnssFixOK NavPVTFlags = 1 << 0 // valid fix (i.e within DOP & accuracy masks)
|
||||
NavPVTDiffSoln NavPVTFlags = 1 << 1 // differential corrections were applied
|
||||
NavPVTHeadVehValid NavPVTFlags = 1 << 5 // heading of vehicle is valid, only set if the receiver is in sensor fusion mode
|
||||
NavPVTCarrSolnFloat NavPVTFlags = 1 << 6 // carrier phase range solution with floating ambiguities
|
||||
NavPVTCarrSolnFixed NavPVTFlags = 1 << 7 // carrier phase range solution with fixed ambiguities
|
||||
NavPVTGnssFixOK NavPVTFlags = 1 << 0 // valid fix (i.e within DOP & accuracy masks)
|
||||
NavPVTDiffSoln NavPVTFlags = 1 << 1 // differential corrections were applied
|
||||
NavPVTHeadVehValid NavPVTFlags = 1 << 5 // heading of vehicle is valid, only set if the receiver is in sensor fusion mode
|
||||
NavPVTCarrSolnFloat NavPVTFlags = 1 << 6 // carrier phase range solution with floating ambiguities
|
||||
NavPVTCarrSolnFixed NavPVTFlags = 1 << 7 // carrier phase range solution with fixed ambiguities
|
||||
)
|
||||
|
||||
type NavPVTFlags2 byte
|
||||
|
||||
const (
|
||||
NavPVTConfirmedAvai NavPVTFlags2 = 1 << 5 // information about UTC Date and Time of Day validity confirmation is available (see Time Validity section for details)
|
||||
NavPVTConfirmedDate NavPVTFlags2 = 1 << 6 // UTC Date validity could be confirmed (see Time Validity section for details)
|
||||
NavPVTConfirmedTime NavPVTFlags2 = 1 << 7 // UTC Time of Day could be confirmed (see Time Validity section for details)
|
||||
NavPVTConfirmedAvai NavPVTFlags2 = 1 << 5 // information about UTC Date and Time of Day validity confirmation is available (see Time Validity section for details)
|
||||
NavPVTConfirmedDate NavPVTFlags2 = 1 << 6 // UTC Date validity could be confirmed (see Time Validity section for details)
|
||||
NavPVTConfirmedTime NavPVTFlags2 = 1 << 7 // UTC Time of Day could be confirmed (see Time Validity section for details)
|
||||
)
|
||||
|
||||
type NavPVTFlags3 byte
|
||||
|
||||
const (
|
||||
NavPVTInvalidLlh NavPVTFlags3 = (1 << iota) // 1 = Invalid lon, lat, height and hMSL
|
||||
NavPVTInvalidLlh NavPVTFlags3 = (1 << iota) // 1 = Invalid lon, lat, height and hMSL
|
||||
)
|
||||
|
||||
239
web/http.go
Normal file
239
web/http.go
Normal file
@ -0,0 +1,239 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.timovolkmann.de/gyrogpsc/core"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/template/html"
|
||||
"github.com/gofiber/websocket/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func CreateServer(s core.Service, sub core.Subscriber, c *core.Configuration) {
|
||||
app := fiber.New(fiber.Config{
|
||||
Views: fiberTemplateEngine(c),
|
||||
})
|
||||
app.Static("/static", "static")
|
||||
|
||||
// Application Main Page
|
||||
app.Get("/", fiberHomeHandler)
|
||||
|
||||
// Websocket
|
||||
app.Get("/ws", websocket.New(createFiberWebsocketHandler(sub)))
|
||||
|
||||
// TODO: Get all SerialPorts
|
||||
// app.Get("/serialports")
|
||||
|
||||
// Tracking persistence controls HTTP JSON RPC API
|
||||
trackings := app.Group("/trackings")
|
||||
trackings.Get("/", allTrackingsHandler(s, c)) // Get all trackings Metadata
|
||||
trackings.Post("/", startPipelineHandler(s, c)) // Initialize new tracking, open websocket and prepare for automatic recording. Toggle ?serial=true and ?tcp=true. Returns trackingId
|
||||
trackings.Patch("/", startRecordingHandler(s, c)) // Starts recording
|
||||
trackings.Put("/", stopRecordingHandler(s, c)) // Stops current recording. Returns trackingId if record was successful
|
||||
trackings.Delete("/", stopAllHandler(s, c)) // Stops websocket connection, pipelines and collectors
|
||||
|
||||
trackings.Get("/:trackingId", stubhander()) // Gets Tracking Metadata and loads sensorRecords from storage.
|
||||
trackings.Delete("/:trackingId", stubhander()) // Deletes Tracking from storage
|
||||
|
||||
trackings.Post("/current", stubhander()) // Starts Replay.
|
||||
trackings.Patch("/current", stubhander()) // Pauses Replay.
|
||||
trackings.Put("/current", stubhander()) // Stops Replay.
|
||||
|
||||
logrus.Fatal(app.Listen(c.Webserver.Port))
|
||||
}
|
||||
|
||||
func stubhander() fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
func allTrackingsHandler(s core.Service, c *core.Configuration) fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
trackings, err := s.AllTrackings()
|
||||
if err != nil {
|
||||
//ctx.Status(500).JSON(err)
|
||||
//return err
|
||||
}
|
||||
prepres := map[string]interface{}{}
|
||||
prepres["data"] = trackings
|
||||
if err != nil {
|
||||
prepres["error"] = err.Error()
|
||||
|
||||
}
|
||||
err2 := ctx.JSON(prepres)
|
||||
if err2 != nil {
|
||||
ctx.Status(500).JSON(err2)
|
||||
return err2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func startPipelineHandler(s core.Service, c *core.Configuration) fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
var collecs []core.CollectorType
|
||||
ser := ctx.Query("serial", "true")
|
||||
if ser == "true" {
|
||||
collecs = append(collecs, core.SERIAL)
|
||||
} else if ser != "false" && ser != "" {
|
||||
collecs = append(collecs, core.CollectorType(ser)) // TODO: allow passing serial port as url parameter
|
||||
}
|
||||
tcp := ctx.Query("tcp", "true")
|
||||
logrus.Debugln("query values: serial/tcp", ser, tcp)
|
||||
if tcp == "true" {
|
||||
collecs = append(collecs, core.TCP)
|
||||
}
|
||||
res, err := s.StartPipeline(collecs...)
|
||||
if err != nil {
|
||||
//ctx.Status(500).JSON(err)
|
||||
//return err
|
||||
}
|
||||
prepres := map[string]interface{}{}
|
||||
prepres["tracking_state"] = res
|
||||
prepres["data"] = collecs
|
||||
if err != nil {
|
||||
prepres["error"] = err.Error()
|
||||
}
|
||||
if len(collecs) == 0 {
|
||||
e := errors.New("attention! no collectors running. start a new pipeline")
|
||||
prepres["error"] = e.Error()
|
||||
}
|
||||
err2 := ctx.JSON(prepres)
|
||||
if err2 != nil {
|
||||
ctx.Status(500).JSON(err2)
|
||||
return err2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func startRecordingHandler(s core.Service, c *core.Configuration) fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
rec, err := s.StartRecord()
|
||||
if err != nil {
|
||||
//ctx.Status(500).JSON(err)
|
||||
//return err
|
||||
}
|
||||
prepres := map[string]interface{}{}
|
||||
prepres["tracking_state"] = "RECORD"
|
||||
prepres["data"] = rec
|
||||
if err != nil {
|
||||
prepres["error"] = err.Error()
|
||||
|
||||
}
|
||||
err2 := ctx.JSON(prepres)
|
||||
if err2 != nil {
|
||||
ctx.Status(500).JSON(err2)
|
||||
return err2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func stopRecordingHandler(s core.Service, c *core.Configuration) fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
rec, err := s.StopRecord()
|
||||
if err != nil {
|
||||
//ctx.Status(500).JSON(err)
|
||||
//return err
|
||||
}
|
||||
prepres := map[string]interface{}{}
|
||||
prepres["tracking_state"] = "LIVE"
|
||||
prepres["data"] = rec
|
||||
if err != nil {
|
||||
prepres["error"] = err.Error()
|
||||
|
||||
}
|
||||
err2 := ctx.JSON(prepres)
|
||||
if err2 != nil {
|
||||
ctx.Status(500).JSON(err2)
|
||||
return err2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func stopAllHandler(s core.Service, c *core.Configuration) fiber.Handler {
|
||||
return func(ctx *fiber.Ctx) error {
|
||||
rec, err := s.StopAll()
|
||||
if err != nil {
|
||||
//ctx.Status(500).JSON(err)
|
||||
//return err
|
||||
}
|
||||
prepres := map[string]interface{}{}
|
||||
prepres["tracking_state"] = "STOPPED"
|
||||
prepres["data"] = rec
|
||||
if err != nil {
|
||||
prepres["error"] = err.Error()
|
||||
|
||||
}
|
||||
err2 := ctx.JSON(prepres)
|
||||
if err2 != nil {
|
||||
ctx.Status(500).JSON(err2)
|
||||
return err2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func createFiberWebsocketHandler(s core.Subscriber) func(conn *websocket.Conn) {
|
||||
return func(c *websocket.Conn) {
|
||||
logrus.Info("new websocket client")
|
||||
// Handle and discard inbound messages
|
||||
go func() {
|
||||
for {
|
||||
if _, _, err := c.NextReader(); err != nil {
|
||||
c.Close()
|
||||
break
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
dispatcherId, channel := s.Subscribe()
|
||||
defer s.Unsubscribe(dispatcherId)
|
||||
for {
|
||||
cmsg := <-channel
|
||||
err := c.WriteMessage(websocket.TextMessage, []byte(cmsg))
|
||||
if err != nil {
|
||||
logrus.Info("close websocket connection")
|
||||
c.Close()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func fiberTemplateEngine(c *core.Configuration) *html.Engine {
|
||||
// Create a new engine by passing the template folder
|
||||
// and template extension using <engine>.New(dir, ext string)
|
||||
engine := html.New("./templates", ".html")
|
||||
|
||||
// We also support the http.FileSystem interface
|
||||
// See examples below to load templates from embedded files
|
||||
// engine := html.NewFileSystem(http.Dir("./views"), ".html")
|
||||
|
||||
// Reload the templates on each render, good for development
|
||||
//engine.Reload(strings.ToLower(c.Debuglevel) == "debug") // Optional. Default: false
|
||||
engine.Reload(true) // Optional. Default: false
|
||||
|
||||
// Debug will print each template that is parsed, good for debugging
|
||||
//engine.Debug(strings.ToLower(c.Debuglevel) == "debug") // Optional. Default: false
|
||||
engine.Debug(true) // Optional. Default: false
|
||||
|
||||
// Layout defines the variable name that is used to yield templates within layouts
|
||||
//engine.Layout("embed") // Optional. Default: "embed"
|
||||
|
||||
// Delims sets the action delimiters to the specified strings
|
||||
//engine.Delims("{{", "}}") // Optional. Default: engine delimiters
|
||||
|
||||
// AddFunc adds a function to the template's global function map.
|
||||
//engine.AddFunc("greet", func(name string) string {
|
||||
// return "Hello, " + name + "!"
|
||||
//})
|
||||
return engine
|
||||
}
|
||||
|
||||
func fiberHomeHandler(c *fiber.Ctx) error {
|
||||
// Render index template
|
||||
return c.Render("index", "ws://"+c.Hostname()+"/ws")
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user