models

package
v0.0.0-...-84c3e8d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeomPoint

type GeomPoint geom.Point

func (*GeomPoint) Scan

func (g *GeomPoint) Scan(value interface{}) error

Scan scan value into geom.Point, implements sql.Scanner interface

func (GeomPoint) Value

func (g GeomPoint) Value() (driver.Value, error)

Value return geometry point value, implement driver.Valuer interface

type KeyAlias

type KeyAlias struct {
	KeyID string `json:"key_id" gorm:"primaryKey"`
	Alias string `json:"alias"`
	Type  string `json:"type"`
}

type KeyInfo

type KeyInfo struct {
	ID     string     `gorm:"primaryKey" json:"id"`
	Alias  *KeyAlias  `gorm:"foreignKey:KeyID;references:ID" json:"alias"`
	LostAt *time.Time `json:"lostAt"`
}

type Location

type Location struct {
	FoundAt         time.Time `gorm:"primaryKey;index:idx_found_at"`
	ReportedAt      time.Time `gorm:"index:idx_reported_at"`
	KeyID           string    `gorm:"primaryKey;index:idx_key_id"`
	OriginalContent []byte
	Geometry        *GeomPoint `gorm:"type:geometry(POINT,4326);index:idx_geometry"`
	Confidence      int        `gorm:"index:idx_confidence"`
	Status          int
	CurrentKeyID    string `gorm:"index:idx_current_key_id"`
}

type LocationResult

type LocationResult struct {
	FoundAt    time.Time `json:"foundAt"`
	ReportedAt time.Time `json:"reportedAt"`
	KeyID      string    `json:"keyId"`
	Lat        float64   `json:"lat"`
	Lng        float64   `json:"lng"`
	Confidence int       `json:"confidence"`
	Status     int       `json:"status"`
}

Jump to

Keyboard shortcuts

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