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.
35 lines
677 B
Go
35 lines
677 B
Go
package prayer
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var ErrInvalidLocation = errors.New("invalid location")
|
|
|
|
type TimesProvider interface {
|
|
Get(ctx context.Context, location string) ([]Times, error)
|
|
Name() string
|
|
}
|
|
|
|
type Coordinates struct {
|
|
Latitude float64
|
|
Longitude float64
|
|
}
|
|
|
|
type LocationTimesProvider interface {
|
|
GetByCoords(ctx context.Context, coords Coordinates) ([]Times, error)
|
|
Name() string
|
|
}
|
|
|
|
type Times struct {
|
|
Date time.Time `json:"date"`
|
|
Fajr string `json:"fajr"`
|
|
Sunrise string `json:"sunrise"`
|
|
Dhuhr string `json:"dhuhr"`
|
|
Asr string `json:"asr"`
|
|
Maghrib string `json:"maghrib"`
|
|
Isha string `json:"isha"`
|
|
}
|