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 27, 2020 License: Apache-2.0 Imports: 12 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 owmbeat.

Types

type Clouds

type Clouds struct {
	Today int `json:"today"`
}

type Coordination

type Coordination struct {
	Lat float32 `json:"Lat"`
	Lon float32 `json:"Lon"`
}

type Main

type Main struct {
	Temp       float32 `json:"temp"`
	Temp_min   float32 `json:"temp_min"`
	Temp_max   float32 `json:"temp_max"`
	Pressure   float32 `json:"pressure"`
	Humidity   int     `json:"humidity"`
	Sea_level  float32 `json:"sea_level"`
	Grnd_level float32 `json:"grnd_level"`
}

type Measure

type Measure struct {
	CityId    int          `json:"id"`
	Timestamp int          `json:"dt"`
	Name      string       `json:"name"`
	Coord     Coordination `json:"coord"`
	Main      Main         `json:"main"`
	Wind      Wind         `json:"wind"`
	Rain      Rain         `json:"rain"`
	Snow      Snow         `json:"snow"`
	Clouds    Clouds       `json:"clouds"`
	Weather   []Weather    `json:"weather"`
}

type OwmResponseData

type OwmResponseData struct {
	Cod          int       `json:"cod"`
	Calctime     float32   `json:"calctime"`
	Cnt          int       `json:"cnt"`
	Measurements []Measure `json:"list"`
}

type Owmbeat

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

Owmbeat configuration.

func (*Owmbeat) GetOWM

func (bt *Owmbeat) GetOWM(region config.Region) error

func (*Owmbeat) Run

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

Run starts owmbeat.

func (*Owmbeat) Stop

func (bt *Owmbeat) Stop()

Stop stops owmbeat.

func (*Owmbeat) TransformOwmData

func (bt *Owmbeat) TransformOwmData(data OwmResponseData, regionName string, regionDesc string) []common.MapStr

type Rain

type Rain struct {
	OneHour    float32 `json:"1h"`
	ThreeHours float32 `json:"3h"`
}

type Snow

type Snow struct {
	OneHour    float32 `json:"1h"`
	ThreeHours float32 `json:"3h"`
}

type Weather

type Weather struct {
	Id          int
	Main        string
	Description string
	Icon        string
}

type Wind

type Wind struct {
	Speed float32 `config:"speed"`
	Deg   float32 `config:"deg"`
}

Jump to

Keyboard shortcuts

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