weather

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	Version string `json:"version"`
	Tos     string `json:"termsofService"`
}

type Condition

type Condition int

func (Condition) String

func (c Condition) String() string

func (*Condition) UnmarshalJSON

func (c *Condition) UnmarshalJSON(b []byte) error

type DailyRecord

type DailyRecord struct {
	Rain    int `json:"rain,string"`
	Fog     int `json:"fog,string"`
	Snow    int `json:"snow,string"`
	Hail    int `json:"hail,string"`
	Thunder int `json:"thunder,string"`
	Tornado int `json:"tornado,string"`

	// Humidity float32 `json:"humidity,string"`  // sometimes ""
	Meantempi     DumbFloat `json:"meantempi,string"`
	Meanpressurei DumbFloat `json:"meanpressurei,string"`
	Precipi       DumbFloat `json:"precipi,string"`
}

type DumbFloat

type DumbFloat float32

func (*DumbFloat) UnmarshalJSON

func (f *DumbFloat) UnmarshalJSON(b []byte) error

type HistoryRecord

type HistoryRecord struct {
	DailyRecord   []DailyRecord  `json:"dailysummary"`
	HourlyRecords []HourlyRecord `json:"observations"`
}

type HourlyRecord

type HourlyRecord struct {
	Time TimeRecord `json:"date"`

	Rain    int `json:"rain,string"`
	Fog     int `json:"fog,string"`
	Snow    int `json:"snow,string"`
	Hail    int `json:"hail,string"`
	Thunder int `json:"thunder,string"`
	Tornado int `json:"tornado,string"`

	Humidity  DumbFloat `json:"hum,string"`
	Tempi     DumbFloat `json:"tempi,string"`
	Pressurei DumbFloat `json:"pressurei,string"`
	Precipi   DumbFloat `json:"precipi,string"`

	// CondString     string `json:"conds"`
	Cond *Condition `json:"conds"`
}

type Main

type Main struct {
	PilosaHost  string
	Concurrency int
	Index       string
	BufferSize  int
	URLFile     string

	WeatherCache *WeatherCache
	// contains filtered or unexported fields
}

func NewMain

func NewMain() *Main

func (*Main) Run

func (m *Main) Run() error

type RecordFile

type RecordFile struct {
	History  HistoryRecord `json:"history"`
	Response ApiResponse   `json:"response"`
}

type TimeRecord

type TimeRecord struct {
	Year int `json:"year,string"`
	Mon  int `json:"mon,string"`
	Mday int `json:"mday,string"`
	Hour int `json:"hour,string"`
	Min  int `json:"min,string"`
}

type WeatherCache

type WeatherCache struct {
	URLFile string
	// contains filtered or unexported fields
}

func NewWeatherCache

func NewWeatherCache() *WeatherCache

func (*WeatherCache) GetDailyRecord

func (c *WeatherCache) GetDailyRecord(day time.Time) (DailyRecord, error)

func (*WeatherCache) GetHourlyRecord

func (c *WeatherCache) GetHourlyRecord(daytime time.Time) (HourlyRecord, error)

func (*WeatherCache) ReadAll

func (c *WeatherCache) ReadAll() error

Jump to

Keyboard shortcuts

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