Documentation
¶
Index ¶
- func DeleteScoutHealths(db *sql.DB, scoutUUID string) error
- func DeleteScoutInteractions(db *sql.DB, scoutUUID string) error
- func DeleteScoutLogs(db *sql.DB, scoutUUID string) error
- func GetScoutUUID(db *sql.DB) string
- func NumScoutHealths(db *sql.DB) (int64, error)
- func NumScoutInteractions(db *sql.DB) (int64, error)
- func NumScoutLogs(db *sql.DB) (int64, error)
- func NumScouts(db *sql.DB) (int64, error)
- func ScoutHealthsAsJSON(db *sql.DB) (string, error)
- func ScoutInteractionsAsJSON(db *sql.DB) (string, error)
- func ScoutSummariesAsJSON(db *sql.DB) (string, error)
- func ScoutsAsJSON(db *sql.DB) ([]string, error)
- type Buckets
- type Command
- type IntBuckets
- type Interaction
- type Path
- type RealArray
- type Scene
- type Scout
- type ScoutHealth
- type ScoutInteraction
- type ScoutLog
- type ScoutState
- type ScoutSummary
- type Waypoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetScoutUUID ¶
Types ¶
type Buckets ¶
type Buckets [configuration.HBuckets][configuration.WBuckets]float32
type IntBuckets ¶
type IntBuckets [configuration.HBuckets][configuration.WBuckets]int
func (*IntBuckets) Scan ¶
func (b *IntBuckets) Scan(value interface{}) error
type Interaction ¶
type Interaction struct { UUID string // The UUID for the scout that detected the interaction. Version string // The Version of the protocol used for transmitting data to the mothership Entered time.Time // The time the interaction started (rounded to nearest half hour) Duration float32 // The total duration of the interaction. Path []Waypoint // The pathway of the interaction through the scene. SceneID int // contains filtered or unexported fields }
func NewInteraction ¶
func NewInteraction(w Waypoint, sId int, s *Scout) Interaction
func (Interaction) Equal ¶
func (i Interaction) Equal(wp []Waypoint) bool
func (*Interaction) LastWaypoint ¶
func (i *Interaction) LastWaypoint() Waypoint
lastWaypoint returns the last waypoint within the interaction.
type Scene ¶
type Scene struct { Interactions []Interaction // The current interactions occuring within the scene. IdleInteractions []Interaction // The current interactions that are idle (resumable). // contains filtered or unexported fields }
type Scout ¶
type Scout struct { UUID string `json:"uuid"` IpAddress string `json:"ip_address"` Port int64 `json:"port"` Authorised bool `json:"authorised"` Name string `json:"name"` State ScoutState `json:"state"` Summary *ScoutSummary `json:"summary"` MinArea float64 DilationIterations int64 ForegroundThresh int64 GaussianSmooth int64 MogHistoryLength int64 MogThreshold float64 MogDetectShadows int64 SimplifyEpsilon float64 MinDuration float32 IdleDuration float32 ResumeSqDistance int64 MaxArea float64 }
type ScoutHealth ¶
type ScoutHealth struct { ScoutUUID string CPU float32 Memory float32 TotalMemory float32 Storage float32 CreatedAt time.Time }
func GetLastScoutHealth ¶
func GetLastScoutHealth(db *sql.DB, scoutUUID string) (*ScoutHealth, error)
func GetScoutHealthByUUID ¶
type ScoutInteraction ¶
type ScoutInteraction struct { Id int64 ScoutUUID string Duration float32 Waypoints Path WaypointWidths Path WaypointTimes RealArray Processed bool EnteredAt time.Time }
func CreateScoutInteraction ¶
func CreateScoutInteraction(i *Interaction) ScoutInteraction
func GetLastScoutInteraction ¶
func GetLastScoutInteraction(db *sql.DB, scoutUUID string) (*ScoutInteraction, error)
func GetScoutInteractionById ¶
func GetScoutInteractionById(db *sql.DB, id int64) (*ScoutInteraction, error)
func GetUnprocessed ¶
func GetUnprocessed(db *sql.DB) ([]*ScoutInteraction, error)
func (*ScoutInteraction) MarkProcessed ¶
func (si *ScoutInteraction) MarkProcessed(db *sql.DB) error
type ScoutLog ¶
func GetScoutLogByUUID ¶
type ScoutState ¶
type ScoutState string
const ( IDLE ScoutState = "idle" CALIBRATING ScoutState = "calibrating" CALIBRATED ScoutState = "calibrated" MEASURING ScoutState = "measuring" )
func (*ScoutState) Scan ¶
func (s *ScoutState) Scan(value interface{}) error
type ScoutSummary ¶
type ScoutSummary struct { ScoutUUID string VisitorCount int64 VisitTimeBuckets Buckets VisitorBuckets IntBuckets }
func GetScoutSummaryByUUID ¶
func GetScoutSummaryByUUID(db *sql.DB, scoutUUID string) (*ScoutSummary, error)
type Waypoint ¶
type Waypoint struct { XPixels int // x-coordinate of waypoint centroid in pixels YPixels int // y-coordinate of waypoint centroid in pixels HalfWidthPixels int // Half the width of the waypoint in pixels HalfHeightPixels int // Half the height of the waypoint in pixels T float32 // The number of seconds elapsed since the beginning of the interaction }
Click to show internal directories.
Click to hide internal directories.