sensor_community

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlDataApi     = "https://data.sensor.community"
	UrlDataApiData = UrlDataApi + "/static/v2/data.json"

	UrlMapsApi       = "https://maps.sensor.community"
	UrlMapsApiData24 = UrlMapsApi + "/data/v2/data.24h.json"
	UrlMapsApiNoise  = UrlMapsApi + "/data/v1/data.noise.json"
	UrlMapsApiTemp   = UrlMapsApi + "/data/v1/data.temp.json"
	UrlMapsApiDust   = UrlMapsApi + "/data/v1/data.dust.json"
	UrlMapsApiLabs   = UrlMapsApi + "/local-labs/labs.json"
)

Variables

This section is empty.

Functions

func FetchData

func FetchData(c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

func FetchDataRadius

func FetchDataRadius(center cfac.Coordinate, radius float64, c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

func FetchDataURL

func FetchDataURL(url string, c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

func FetchDust

func FetchDust(c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

func FetchLabs

func FetchLabs(coord cfac.Coordinate, c *colly.Collector, cb func(Lab), ecb cfac.ErrorCallback)

func FetchNoise

func FetchNoise(c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

func FetchTemp

func FetchTemp(c *colly.Collector, cb func(Sensor), ecb cfac.ErrorCallback)

Types

type Lab

type Lab struct {
	Lat           float64 `json:"lat"`
	Lon           float64 `json:"lon"`
	Title         string  `json:"title"`
	Text          string  `json:"text"`
	MeetingsTitle string  `json:"meetings_title"`
	Meetings      []struct {
		Text string `json:"text"`
	} `json:"meetings"`
	ContactsTitle string `json:"contacts_title"`
	Contacts      []struct {
		Name string `json:"name"`
		URL  string `json:"url"`
	} `json:"contacts"`
	Website       string `json:"website,omitempty"`
	Twitter       string `json:"twitter,omitempty"`
	Github        string `json:"github,omitempty"`
	Meetup        string `json:"meetup,omitempty"`
	FacebookPage  string `json:"facebook_page,omitempty"`
	Instagram     string `json:"instagram,omitempty"`
	Telegram      string `json:"telegram,omitempty"`
	Facebook      string `json:"facebook,omitempty"`
	FacebookGroup string `json:"facebook_group,omitempty"`
	TelegramGroup string `json:"telegram_group,omitempty"`
	Mastodon      string `json:"mastodon,omitempty"`
}

type ResponseLabs

type ResponseLabs []Lab

type Sensor

type Sensor struct {
	Sensor       SensorInfo         `json:"sensor"`
	Location     SensorLocation     `json:"location"`
	ID           int                `json:"id"`
	DataValues   []SensorDataValues `json:"sensordatavalues"`
	Timestamp    string             `json:"timestamp"`
	SamplingRate interface{}        `json:"sampling_rate"`
}

type SensorDataValues

type SensorDataValues struct {
	Value     string `json:"value"`
	ValueType string `json:"value_type"`
	ID        int    `json:"id"`
}

type SensorInfo

type SensorInfo struct {
	Pin        string     `json:"pin"`
	ID         int        `json:"id"`
	SensorType SensorType `json:"sensor_type"`
}

type SensorLocation

type SensorLocation struct {
	ID            int     `json:"id"`
	Indoor        int     `json:"indoor"`
	ExactLocation int     `json:"exact_location"`
	Latitude      float64 `json:"latitude,string"`
	Longitude     float64 `json:"longitude,string"`
	Altitude      float64 `json:"altitude,string"`
	Country       string  `json:"country"`
}

type SensorType

type SensorType struct {
	ID           int    `json:"id"`
	Manufacturer string `json:"manufacturer"`
	Name         string `json:"name"`
}

Jump to

Keyboard shortcuts

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