prayer

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrayerService

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

func NewPrayerService

func NewPrayerService(token string) *PrayerService

func (*PrayerService) Times

func (t *PrayerService) Times(request *TimesRequest) (*TimesResponse, error)

Get the prayer (salah) times for a location on a given date

type PrayerTime

type PrayerTime struct {
	// asr time
	Asr string `json:"asr"`
	// date for prayer times in YYYY-MM-DD format
	Date string `json:"date"`
	// fajr time
	Fajr string `json:"fajr"`
	// isha time
	Isha string `json:"isha"`
	// maghrib time
	Maghrib string `json:"maghrib"`
	// time of sunrise
	Sunrise string `json:"sunrise"`
	// zuhr time
	Zuhr string `json:"zuhr"`
}

type TimesRequest

type TimesRequest struct {
	// optional date in YYYY-MM-DD format, otherwise uses today
	Date string `json:"date"`
	// number of days to request times for
	Days int32 `json:"days"`
	// optional latitude used in place of location
	Latitude float64 `json:"latitude"`
	// location to retrieve prayer times for.
	// this can be a specific address, city, etc
	Location string `json:"location"`
	// optional longitude used in place of location
	Longitude float64 `json:"longitude"`
}

type TimesResponse

type TimesResponse struct {
	// date of request
	Date string `json:"date"`
	// number of days
	Days int32 `json:"days"`
	// latitude of location
	Latitude float64 `json:"latitude"`
	// location for the request
	Location string `json:"location"`
	// longitude of location
	Longitude float64 `json:"longitude"`
	// prayer times for the given location
	Times []PrayerTime `json:"times"`
}

Jump to

Keyboard shortcuts

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