gammasense

package
v0.0.0-...-441f3cd Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlApi         = "https://data.waag.org/api/gammasense"
	UrlApiStations = UrlApi + "/stations"
	UrlApiHourly   = UrlApi + "/hourly?sensor_id={sensor_id}&start={start}&end={end}" // TS: 2021-07-07T20:00:00.000Z
	UrlApiRecent   = UrlApi + "/recent"
)

Variables

This section is empty.

Functions

func FetchHourly

func FetchHourly(sid string, start, end time.Time, c *colly.Collector, cb MeasurementListCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchRecent

func FetchRecent(c *colly.Collector, cb MeasurementListCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchStationMeasurements

func FetchStationMeasurements(c *colly.Collector, cb StationCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

func FetchStations

func FetchStations(c *colly.Collector, cb StationListCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

func NewMeasurable

func NewMeasurable() cfac.Measurable

Types

type Measurable

type Measurable struct{}

func (*Measurable) Fetch

func (m *Measurable) Fetch(c *colly.Collector, cb cfac.MeasurementCallback, ecb cfac.ErrorCallback) *sync.WaitGroup

type Measurement

type Measurement struct {
	Time    time.Time `json:"timestamp"`
	CPMMean float64   `json:"cpm_mean"`
	ID      string    `json:"id"`
}

type MeasurementListCallback

type MeasurementListCallback func([]Measurement)

type ResponseHourly

type ResponseHourly []Measurement

type ResponseRecent

type ResponseRecent []Measurement

type ResponseStations

type ResponseStations []Station

type Station

type Station struct {
	SensorType  string    `json:"sensor_type"`
	ID          string    `json:"id"`
	Coordinates []float32 `json:"coordinates"`

	Measurement *Measurement `json:"-,omitempty"`
}

func (Station) Measure

func (s Station) Measure() []cfac.Measurement

type StationCallback

type StationCallback func(Station)

type StationListCallback

type StationListCallback func([]Station)

Jump to

Keyboard shortcuts

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