krisinformation

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistanceInMeters

func DistanceInMeters(lat1, lon1, lat2, lon2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

http://en.wikipedia.org/wiki/Haversine_formula

Types

type Client

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

Client holds or configuration

func NewClient

func NewClient(latitude, longitude float64, radius int, county string, country bool) *Client

NewClient returns a new Client

type Item

type Item struct {
	PushMessage string
	HeadLine    string
	SenderName  string
	Country     bool
	County      bool
	Distance    float64
	Updated     time.Time
}

Item holds the interesting parts

type Krisinformation

type Krisinformation []struct {
	Identifier  string    `json:"Identifier"`
	PushMessage string    `json:"PushMessage"`
	Updated     time.Time `json:"Updated"`
	Published   time.Time `json:"Published"`
	Headline    string    `json:"Headline"`
	Preamble    string    `json:"Preamble"`
	BodyText    string    `json:"BodyText"`
	Area        []struct {
		Type                string      `json:"Type"`
		Description         string      `json:"Description"`
		Coordinate          string      `json:"Coordinate"`
		GeometryInformation interface{} `json:"GeometryInformation"`
	} `json:"Area"`
	Web        string        `json:"Web"`
	Language   string        `json:"Language"`
	Event      string        `json:"Event"`
	SenderName string        `json:"SenderName"`
	Push       bool          `json:"Push"`
	BodyLinks  []interface{} `json:"BodyLinks"`
	SourceID   int           `json:"SourceID"`
	IsVma      bool          `json:"IsVma"`
	IsTestVma  bool          `json:"IsTestVma"`
}

type Settings

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

Settings defines the configuration properties for this module

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

NewSettingsFromYAML creates a new settings instance from a YAML config block

type Widget

type Widget struct {
	view.TextWidget
	// contains filtered or unexported fields
}

Widget is the container for your module's data

func NewWidget

func NewWidget(app *tview.Application, settings *Settings) *Widget

NewWidget creates and returns an instance of Widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

Refresh updates the onscreen contents of the widget

Jump to

Keyboard shortcuts

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