Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtendedTideResponse ¶
type ExtendedTideResponse struct { ResponseType string `json:"responseType"` Timestamp int64 `json:"timestamp"` LocalTime string `json:"localTime"` // Add this field WaterLevel *float64 `json:"waterLevel"` PredictedLevel *float64 `json:"predictedLevel"` NearestStation string `json:"nearestStation"` Location *string `json:"location"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` StationDistance float64 `json:"stationDistance"` TideType *TideType `json:"tideType"` CalculationMethod string `json:"calculationMethod"` Extremes []TideExtreme `json:"extremes"` Predictions []TidePrediction `json:"predictions"` TimeZoneOffsetSeconds *int `json:"timeZoneOffsetSeconds"` }
ExtendedTideResponse represents the full tide response including predictions and extremes
func (*ExtendedTideResponse) Validate ¶
func (r *ExtendedTideResponse) Validate() error
Validate checks if an ExtendedTideResponse's fields are valid
type NoaaPrediction ¶
type NoaaPrediction struct { Time string `json:"t"` // Time of prediction Height string `json:"v"` // Predicted water level Type *string `json:"type,omitempty"` // Type of prediction (H for high, L for low) }
NoaaPrediction represents the raw NOAA API prediction response
type NoaaResponse ¶
type NoaaResponse struct { Predictions []NoaaPrediction `json:"predictions"` Error *struct { Message string `json:"message"` } `json:"error,omitempty"` }
type Station ¶
type Station struct { ID string `json:"id"` Name string `json:"name"` State *string `json:"state,omitempty"` Region *string `json:"region,omitempty"` Distance float64 `json:"distance"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Source Source `json:"source"` Capabilities []string `json:"capabilities"` TimeZoneOffset int `json:"timeZoneOffset"` Level *string `json:"level,omitempty"` StationType *string `json:"stationType,omitempty"` }
type StationFinder ¶
type TideExtreme ¶
type TideExtreme struct { Type TideType `json:"type"` Timestamp int64 `json:"timestamp"` LocalTime string `json:"localTime"` Height float64 `json:"height"` }
TideExtreme represents a high or low tide
func (*TideExtreme) Validate ¶
func (te *TideExtreme) Validate() error
Validate checks if a TideExtreme's fields are valid
type TidePrediction ¶
type TidePrediction struct { Timestamp int64 `json:"timestamp"` LocalTime string `json:"localTime"` Height float64 `json:"height"` }
TidePrediction represents a tide prediction at a specific time
func (TidePrediction) GetTimestamp ¶
func (tp TidePrediction) GetTimestamp() int64
func (*TidePrediction) Validate ¶
func (tp *TidePrediction) Validate() error
Validate checks if a TidePrediction's fields are valid
type TidePredictionRecord ¶
type TidePredictionRecord struct { StationID string `dynamodbav:"stationId"` Date string `dynamodbav:"date"` StationType string `dynamodbav:"stationType"` // R for reference, S for subordinate Predictions []TidePrediction `dynamodbav:"predictions"` Extremes []TideExtreme `dynamodbav:"extremes"` LastUpdated int64 `dynamodbav:"lastUpdated"` TTL int64 `dynamodbav:"ttl"` }
models.TidePredictionRecord represents a cached set of predictions for a station and date
func (*TidePredictionRecord) Validate ¶
func (r *TidePredictionRecord) Validate() error
Validate checks if a TidePredictionRecord's fields are valid
Click to show internal directories.
Click to hide internal directories.