Documentation ¶
Index ¶
Constants ¶
View Source
const AztroBaseURL = "https://aztro.sameerkumar.website"
Variables ¶
This section is empty.
Functions ¶
func WithDay ¶
func WithDay(day Day) func(*AztroRequestParam)
WithDay is function to add Day into AztroRequestParam
Types ¶
type AztroClient ¶
AztroClient is struct represent a client to query to Aztro API
func NewAztroClient ¶
func NewAztroClient() (*AztroClient, error)
NewAztroClient is function to create AztroClient
func (*AztroClient) GetHoroscope ¶
func (ac *AztroClient) GetHoroscope(param *AztroRequestParam) (Horoscope, *AztroErr)
GetHoroscope is function to get a horoscope based on requested param
type AztroErr ¶
type AztroErr struct { Message string `json:"message"` HTTPStatusCode int `json:"status_code,omitempty"` }
AztroErr is struct that represent error object from Aztro API
type AztroRequestParam ¶
AztroRequestParam struct represent a request parameter to query from Aztro API
func NewAztroRequestParam ¶
func NewAztroRequestParam(sign Sign, opts ...func(*AztroRequestParam)) *AztroRequestParam
NewAztroRequestParam is function to create a new AztroRequestParam, Default Day=Today
type Horoscope ¶
type Horoscope struct { DateRange string `json:"date_range"` CurrentDate string `json:"current_date"` Description string `json:"description"` Compatibility string `json:"compatibility"` Mood string `json:"mood"` Color string `json:"color"` LuckyNumber string `json:"lucky_number"` LuckyTime string `json:"lucky_time"` }
Horoscope is struct that represent a horoscope
type IAztroClient ¶
type IAztroClient interface {
GetHoroscope(param *AztroRequestParam) (Horoscope, *AztroErr)
}
IAztroClient is interface that represent a query to Aztro API
Click to show internal directories.
Click to hide internal directories.