model

package
v0.0.0-...-161b44b Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dive

type Dive struct {
	SensorID   string        `json:"sensorId" firestore:"sensorId,omitempty"`
	StartTime  time.Time     `json:"startTime"  firestore:"startTime,omitempty"`
	EndTime    time.Time     `json:"duration"  firestore:"endTime,omitempty"`
	StartPoint GeoPoint      `json:"startPoint" firestore:"startPoint,omitempty"`
	EndPoint   GeoPoint      `json:"endPoint" firestore:"endPoint,omitempty"`
	SensorData []*SensorData `json:"sensorData" firestore:"sensorData,omitempty"`
}

Dive is a dive

func MapDive

func MapDive(data map[string]interface{}) Dive

MapDive will convert a map into a dive

type DiveImplementation

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

DiveImplementation is an object for CRUD operations on dives

func (DiveImplementation) Create

func (di DiveImplementation) Create(ctx context.Context, dive Dive) error

Create will create a new dive

func (DiveImplementation) List

func (di DiveImplementation) List(ctx context.Context) []*Dive

List will fetch all of the dives

type DiveInterface

type DiveInterface interface {
	Create(context.Context, Dive) error
	List(context.Context) []*Dive
}

DiveInterface is an interface for interacting with dive results

func NewDiveImplementation

func NewDiveImplementation(client wrapper.DBClientInterface) DiveInterface

NewDiveImplementation will return an object for working with dives

type GeoPoint

type GeoPoint struct {
	Lat  float64 `json:"lat"`
	Long float64 `json:"long"`
}

type SensorData

type SensorData struct {
	Depth       float64 `json:"depth"`
	RawPressure int     `json:"rawPressure"`
	RawTemp     int     `json:"rawTemp"`
	Temp        float64 `json:"temp"`
	Time        int     `json:"time"`
}

func MapSensorData

func MapSensorData(data map[string]interface{}) SensorData

MapSensorData will convert map to SensorData object

Jump to

Keyboard shortcuts

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