beater

package
v7.6.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error)

New creates an instance of earthquakebeat.

Types

type EQResponse

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

type EarthquakeResponse

type EarthquakeResponse struct {
	Type     string `json:"type"`
	Metadata struct {
		Generated int64  `json:"generated"`
		Url       string `json:"url"`
		Title     string `json:"title"`
		Status    int    `json:"status"`
		Api       string `json:"api"`
		Count     int    `json:"count"`
	}
	Features []Feature
}

type Earthquakebeat

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

Earthquakebeat configuration.

func (*Earthquakebeat) GetEarthquakes

func (bt *Earthquakebeat) GetEarthquakes(b *beat.Beat, lastRun time.Time, CAFile string, new bool) (error, EQResponse)

func (*Earthquakebeat) Run

func (bt *Earthquakebeat) Run(b *beat.Beat) error

Run starts earthquakebeat.

func (*Earthquakebeat) Stop

func (bt *Earthquakebeat) Stop()

Stop stops earthquakebeat.

func (*Earthquakebeat) TransformStationData

func (bt *Earthquakebeat) TransformStationData(data EarthquakeResponse) []common.MapStr

type Feature

type Feature struct {
	Type       string     `json:"type"`
	Properties Properties `json:"properties"`
	Geometry   Geometry   `json:"geometry"`
	Id         string     `json:"id"`
}

https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php

type Geometry

type Geometry struct {
	Type string `json:"type"`
	// Longitude, Latitude, depth
	Coordinates []float64 `json:"coordinates"`
}

type Properties

type Properties struct {
	Mag     float64 `json:"mag"`
	Place   string  `json:"place"`
	Time    int64   `json:"time"`
	Updated int64   `json:"updated"`
	Tz      int     `json:"tz"`
	Url     string  `json:"url"`
	Detail  string  `json:"detail"`
	Felt    int     `json:"felt"`
	Cdi     float32 `json:"cdi"`
	Mmi     float32 `json:"mmi"`
	Alert   string  `json:"alert"`
	Status  string  `json:"status"`
	Tsunami int     `json:"tsunami"`
	Sig     int     `json:"sig"`
	Net     string  `json:"net"`
	Code    string  `json:"code"`
	Ids     string  `json:"ids"`
	Sources string  `json:"sources"`
	Types   string  `json:"types"`
	Nst     int     `json:"nst"`
	Dmin    float64 `json:"dmin"`
	Rms     float64 `json:"rms"`
	Gap     float64 `json:"gap"`
	MagType string  `json:"magType"`
	Type    string  `json:"type"`
	Title   string  `json:"title"`
}

https://earthquake.usgs.gov/data/comcat/data-eventterms.php

Jump to

Keyboard shortcuts

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