Documentation ¶
Index ¶
- func DeleteScoutHealths(db *sql.DB, scoutId int64) error
- func DeleteScoutInteractions(db *sql.DB, scoutId int64) error
- func DeleteScoutLogs(db *sql.DB, scoutId int64) error
- 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 IntBuckets
- type Interaction
- type Path
- type RealArray
- 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 ¶
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. }
type Scout ¶
type Scout struct { Id int64 `json:"id"` 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"` }
type ScoutHealth ¶
type ScoutHealth struct { ScoutId int64 CPU float32 Memory float32 TotalMemory float32 Storage float32 CreatedAt time.Time }
func GetLastScoutHealth ¶
func GetLastScoutHealth(db *sql.DB, scoutId int64) (*ScoutHealth, error)
func GetScoutHealthById ¶
type ScoutInteraction ¶
type ScoutInteraction struct { Id int64 ScoutId int64 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, scoutId int64) (*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 GetScoutLogById ¶
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 { ScoutId int64 VisitorCount int64 VisitTimeBuckets Buckets VisitorBuckets IntBuckets }
func GetScoutSummaryById ¶
func GetScoutSummaryById(db *sql.DB, scoutId int64) (*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.