model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

model package has the data types of data we keep in the datastore.

model package has the data types of data we keep in the datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	VideoStreamID    int
	TimeSpan         TimeSpan
	BoundingBox      *BoundingBox // Optional.
	Observer         string
	ObservationPairs []string
	ObservationKeys  []string // A copy of the map's keys are stored separately, so we can quickly query for annotations with a given key present.
}

An Annotation holds information about observations at a particular moment and region within a video stream.

func (*Annotation) Decode

func (an *Annotation) Decode(b []byte) error

Encode deserializes Annotation. Implements Entity interface. Used for FileStore datastore.

func (*Annotation) Encode

func (an *Annotation) Encode() []byte

Encode serializes Annotation. Implements Entity interface. Used for FileStore datastore.

type BoundingBox

type BoundingBox struct {
	X1 int `json:"x1"`
	X2 int `json:"x2"`
	Y1 int `json:"y1"`
	Y2 int `json:"y2"`
}

BoundingBox is a rectangle enclosing something interesting in a video. It is represented using two x y coordinates, top left corner and bottom right corner of the rectangle.

type CaptureSource

type CaptureSource struct {
	Name           string
	Location       datastore.GeoPoint
	CameraHardware string
	SiteID         *int64 // Optional.
}

A CaptureSource holds the information about where a video stream came from. A single capture source will produce multiple video streams (typically one per day).

func (*CaptureSource) Decode

func (cs *CaptureSource) Decode(b []byte) error

Encode deserializes Capture source. Implements Entity interface. Used for FileStore datastore.

func (*CaptureSource) Encode

func (cs *CaptureSource) Encode() []byte

Encode serializes Capture source. Implements Entity interface. Used for FileStore datastore.

type TimeSpan

type TimeSpan struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

TimeSpan is a pair of timestamps - start time and end time.

type VideoStream

type VideoStream struct {
	StartTime     time.Time
	EndTime       *time.Time // Optional.
	StreamUrl     string
	CaptureSource int64
}

VideoStream holds the information about a single video stream. VideoStream contains the url for a live or completed stream off of youtube, the start time, the end time (unless it is still ongoing), and the ID of its capture source. In the future, it will also contain data about how to retrieve the video data from the cloud.

func (*VideoStream) Decode

func (vs *VideoStream) Decode(b []byte) error

Encode deserializes VideoStream. Implements Entity interface. Used for FileStore datastore.

func (*VideoStream) Encode

func (vs *VideoStream) Encode() []byte

Encode serializes VideoStream. Implements Entity interface. Used for FileStore datastore.

Jump to

Keyboard shortcuts

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