api

package
v0.0.0-...-a73e329 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIdleConnections int = 20
	RequestTimeout     int = 300
)

Variables

View Source
var AIPort = "8002"

AIPort designates the port for the AI processing

View Source
var DataFolder = "."
View Source
var MainPort string

Functions

func AnalyzeSensorData

func AnalyzeSensorData(s models.SensorData) (aidata models.LocationAnalysis, err error)

func Calibrate

func Calibrate(family string, crossValidation ...bool) (err error)

Calibrate will send the sensor data for a specific family to the machine learning algorithms

func Debug

func Debug(debugMode bool)

func Dump

func Dump(family string) (err error)

func GenerateImages

func GenerateImages(family string)

func GetByLocation

func GetByLocation(family string, minutesAgoInt int, showRandomized bool, activeMinsThreshold int, minScanners int, minProbability float64, deviceCounts map[string]int) (byLocations []models.ByLocation, err error)

func GetGPSData

func GetGPSData(family string) (gpsData map[string]models.SensorData, err error)

GetGPSData returns the latest GPS data

func GetImage

func GetImage(family, location string) (img []byte, err error)

func SavePrediction

func SavePrediction(s models.SensorData, p models.LocationAnalysis) (err error)

SavePrediction will add sensor data to the database

func SaveSensorData

func SaveSensorData(p models.SensorData) (err error)

SaveSensorData will add sensor data to the database

Types

type AnalysisResponse

type AnalysisResponse struct {
	Data    models.LocationAnalysis `json:"analysis"`
	Message string                  `json:"message"`
	Success bool                    `json:"success"`
}

type Pair

type Pair struct {
	Key   string
	Value float64
}

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type UpdateCounterMap

type UpdateCounterMap struct {
	// Data maps family -> counts of locations
	Count map[string]int
	sync.RWMutex
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL