db

package
v0.0.0-...-b066f40 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

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 New

func New() *DB

func (*DB) GetDetectionsBetweenIds

func (db *DB) GetDetectionsBetweenIds(a, b int64) (*[]Detection, error)

func (*DB) GetLastDetection

func (db *DB) GetLastDetection() (*Detection, error)

func (*DB) GetLastDetectionId

func (db *DB) GetLastDetectionId() (int64, error)

func (*DB) GetLimitedIdsAfter

func (db *DB) GetLimitedIdsAfter(a, limit int) (*[]Detection, error)

func (*DB) InsertDetection

func (db *DB) InsertDetection(detection *Detection) (int64, error)

type Detection

type Detection struct {
	ID                int64   `json:"id" gorm:"primaryKey,autoIncrement"`
	DetectionTime     float64 `json:"detection_timestamp"`
	Mac               string  `json:"mac"`
	Rssi              int     `json:"rssi"`
	UptimeMs          uint64  `json:"uptime_ms"`
	BatteryPercentage uint8   `json:"battery"`
}

func (*Detection) TableName

func (D *Detection) TableName() string

Jump to

Keyboard shortcuts

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