You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1 KiB
Go

package prayer
import (
"errors"
"time"
)
var ErrInvalidLocation = errors.New("invalid location")
type Coordinates struct {
Latitude float64
Longitude float64
}
type Location struct {
ID int `json:"id"`
Name string `json:"name"`
ASCIIName string `json:"ascii_name"`
AlternateNames string `json:"alternate_names"`
CountryCode string `json:"country_code"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Timezone string `json:"timezone,omitempty"`
}
type Times struct {
Date time.Time `json:"date"`
DateHijri string `json:"date_hijri"`
Fajr time.Time `json:"fajr"`
Sunrise time.Time `json:"sunrise"`
Dhuhr time.Time `json:"dhuhr"`
Asr time.Time `json:"asr"`
Sunset time.Time `json:"sunset,omitempty"`
Maghrib time.Time `json:"maghrib"`
Isha time.Time `json:"isha"`
}
type TimesResult struct {
Location Location `json:"location"`
Times []Times `json:"prayertimes"`
}
type LegacyLocation struct {
ID int
Country string
City string
Region string
Latitude float64
Longitude float64
Timezone string
}