measurement

package
v0.0.0-...-26e7deb Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Collection = "measurements"

Variables

View Source
var ErrNotFound = errors.New("measurement with given ID not found")

Functions

This section is empty.

Types

type Measurement

type Measurement struct {
	Name          string    `json:"name" firestore:"name"`
	MAC           string    `json:"mac" firestore:"mac"`
	Timestamp     time.Time `json:"ts" firestore:"ts"`
	Temperature   float64   `json:"temperature" firestore:"temperature"`
	Humidity      float64   `json:"humidity" firestore:"humidity"`
	Pressure      float64   `json:"pressure" firestore:"pressure"`
	Battery       int       `json:"battery" firestore:"battery"`
	AccelerationX int       `json:"acceleration_x" firestore:"acceleration_x"`
	AccelerationY int       `json:"acceleration_y" firestore:"acceleration_y"`
	AccelerationZ int       `json:"acceleration_z" firestore:"acceleration_z"`
	ID            string    `json:"id" firestore:"-"`
}

type Service

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

func NewService

func NewService(client *firestore.Client) *Service

func (*Service) GetMeasurement

func (s *Service) GetMeasurement(ctx context.Context, id string) (m Measurement, err error)

func (*Service) ListMeasurements

func (s *Service) ListMeasurements(ctx context.Context, name string, from, to time.Time, limit int) (measurements []Measurement, err error)

Jump to

Keyboard shortcuts

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