tides

package
v0.0.0-...-dafb21f Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	XMLName     xml.Name      `xml:"datainfo"`
	Items       []*Prediction `xml:"data>item"`
	State       string        `xml:"state"`
	StationType string        `xml:"stationtype"`
	StationID   string        `xml:"stationid"`
}

Location holds station information and the tide predictions

func (*Location) FindNearestPrediction

func (loc *Location) FindNearestPrediction(date string) *Prediction

FindNearestPrediction finds the closest prediction to the provided date, using binary search until we move to a smarter data structure

func (Location) String

func (loc Location) String() string

type ObservationHolder

type ObservationHolder struct {
	Locations map[string]*Location
}

ObservationHolder maps a station id to the location

func (*ObservationHolder) LoadDataStore

func (holder *ObservationHolder) LoadDataStore(dir string) error

LoadDataStore loads all prediction files in the given directory

type Prediction

type Prediction struct {
	Level     string
	HighOrLow string  `xml:"highlow"`
	Date      string  `xml:"date"`
	Feet      float32 `xml:"predictions_in_ft"`
	Time      string  `xml:"time"`
	Direction string
}

Prediction is provided by the NOAA

func (Prediction) String

func (p Prediction) String() string

Jump to

Keyboard shortcuts

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