api

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2018 License: MIT Imports: 21 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 = "."

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 GetByLocation

func GetByLocation(family string, minutesAgoInt int, showRandomized bool, activeMinsThreshold int, minScanners int, minProbability float64) (byLocations []models.ByLocation, 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