Documentation ¶
Index ¶
- type Azan
- func (a *Azan) Generate(latitude, longitude, timezone float64, city string) error
- func (a *Azan) GetAll() ([]CalcResult, error)
- func (a *Azan) GetByCity(city string) (CalcResult, error)
- func (a *Azan) GetByCityDate(city string, date time.Time) (CalcResult, error)
- func (a *Azan) GetByCityMonth(city string, month int) (CalcResult, error)
- func (a *Azan) GetCache(key string) ([]byte, error)
- func (a *Azan) GetCities() ([]CalcResult, error)
- func (a *Azan) SetCache(key string, data []byte) error
- type AzanSchedule
- type CacheProvider
- type CalcProvider
- type CalcResult
- type DbProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Azan ¶
type Azan struct {
// contains filtered or unexported fields
}
azan
func New ¶
func New(database DbProvider, cache CacheProvider, calculation CalcProvider) *Azan
func (*Azan) GetAll ¶
func (a *Azan) GetAll() ([]CalcResult, error)
func (*Azan) GetByCityDate ¶
func (*Azan) GetByCityMonth ¶
func (a *Azan) GetByCityMonth(city string, month int) (CalcResult, error)
func (*Azan) GetCities ¶
func (a *Azan) GetCities() ([]CalcResult, error)
type AzanSchedule ¶
type CacheProvider ¶
cache contract
type CalcProvider ¶
type CalcProvider interface { // latitude, longitude, timezone, city Calculate(float64, float64, float64, string) CalcResult }
calculation contract
type CalcResult ¶
type CalcResult struct { City string `json:"city"` Latitude float64 `json:"lat"` Longitude float64 `json:"long"` Timezone float64 `json:"timezone"` Schedule []AzanSchedule `json:"schedule"` }
type DbProvider ¶
type DbProvider interface { Set(CalcResult) error Validate(float64, float64, string) (bool, error) GetAll() ([]CalcResult, error) GetByCity(string) (CalcResult, error) GetByCityDate(string, time.Time) (CalcResult, error) GetByCityMonth(string, int) (CalcResult, error) GetCities() ([]CalcResult, error) }
database contract
Click to show internal directories.
Click to hide internal directories.