cocorahs

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 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 CocorahsClient

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

func New

func New() *CocorahsClient

func (*CocorahsClient) GetStationArchive

func (c *CocorahsClient) GetStationArchive(stationNumber string) (StationArchive, error)

type DailyObservation

type DailyObservation struct {
	ObservationDate string     `json:"obsDate"`
	ObservationTime string     `json:"obsTime"`
	GaugeCatch      GaugeCatch `json:"gaugeCatch"`
}

func (DailyObservation) GetObservationDateTime

func (d DailyObservation) GetObservationDateTime() time.Time

type GaugeCatch

type GaugeCatch struct {
	Value   float64 `json:"value"`
	IsTrace bool    `json:"isTrace"`
}

type StationArchive

type StationArchive struct {
	StationMetadata   StationMetadata    `json:"stationMetadata"`
	DailyObservations []DailyObservation `json:"dailyObs"`
}

func (StationArchive) GetLastObservation

func (s StationArchive) GetLastObservation(requireToday bool) (DailyObservation, error)

func (StationArchive) GetLastObservationDate

func (s StationArchive) GetLastObservationDate() (time.Time, bool, error)

type StationMetadata

type StationMetadata struct {
	Id                  int64  `json:"id"`
	StationNumber       string `json:"stationNumber"`
	LastObservationDate string `json:"lastObsDate"`
}

Jump to

Keyboard shortcuts

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