trackerdb

package module
v0.0.0-...-b821c66 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: MIT Imports: 6 Imported by: 0

README

Sky Hub logo

License Chat Twitter

Supporting Sky Hub

Sky Hub is an MIT-licensed open source project with its ongoing development made possible entirely by volunteers.

Want to be a backer? Let us know at skyhubuser@gmail.com

Introduction

Sky Hub is a software platform for using cameras and sensors to collect data on the UAP/UFO phenomenon.

Questions, or Issues?

For questions and support please use the community chat.

Stay In Touch

Contribution

Feel free to send us a pull request or if you would like to join the project catch us over in our RocketChat

Thank you to all the people who already contributed to Vue!

License

MIT

Copyright (c) 2020-present, Steve McDaniel, Corey Gaspard

Documentation

Overview

MIT License -----------

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func (*DB) AddEvent

func (db *DB) AddEvent(rec *Event, event_data interface{}) (err error)

func (*DB) AddSensorData

func (db *DB) AddSensorData(rec *Sensor) (err error)

func (*DB) AddVideoEvent

func (db *DB) AddVideoEvent(eventId string, videoUri string, thumbnailUri string) (err error)

func (*DB) Close

func (db *DB) Close()

func (*DB) GetEvents

func (db *DB) GetEvents(limit int32) (events []Event, count int32, err error)

func (*DB) GetVideoEventNotUploaded

func (db *DB) GetVideoEventNotUploaded() (videoEvent VideoEvent, err error)

func (*DB) GetVideoEvents

func (db *DB) GetVideoEvents(limit int32, page int32) (events []VideoEvent, count int32, err error)

func (*DB) Open

func (db *DB) Open(uri string) (err error)

func (*DB) Save

func (db *DB) Save(v interface{})

func (*DB) StartEvent

func (db *DB) StartEvent(uuid string, ts time.Time, eventType string, eventSource string, sensor string)

func (*DB) StopEvent

func (db *DB) StopEvent(
	uuid string,
	ts time.Time,
	duration int64)

type Event

type Event struct {
	Id        string    `gorm:"type:text; PRIMARY_KEY"`
	CreatedAt time.Time `gorm:"type:datetime;Column:created_at"`
	StartedAt time.Time `gorm:"type:datetime;Column:started_at"`
	EndedAt   time.Time `gorm:"type:datetime;Column:ended_at"`
	Duration  int64     `gorm:"type:int64"`
	Type      string    `gorm:"type:text"`
	Source    string    `gorm:"type:text"`
	Sensor    string    `gorm:"type:text"`
}

type Sensor

type Sensor struct {
	EventId   string    `gorm:"column:event_id;null;index;default:NULL" json:"event_id"`
	CreatedAt time.Time `gorm:"type:datetime;Column:created_at"`
	Data      []byte    `gorm:"type:blob"`
}

type VideoEvent

type VideoEvent struct {
	EventId      string    `gorm:"column:event_id; PRIMARY_KEY" json:"event_id"`
	CreatedAt    time.Time `gorm:"type:datetime;Column:created_at"`
	Uri          string    `gorm:"type:text"`
	Thumbnail    string    `gorm:"type:text"`
	IsUploaded   bool      `gorm:"default:false"`
	IsPending    bool      `gorm:"default:false"`
	IsInprogress bool      `gorm:"default:false"`
}

Jump to

Keyboard shortcuts

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