Documentation ¶
Index ¶
- Constants
- type Business
- type Businesses
- type Deal
- type DealMap
- func (dm *DealMap) DealDetails(id string) (*Deal, error)
- func (dm *DealMap) SearchBusinesses(location string, query string, distanceMi int, startIndex int, pageSize int, ...) (*Businesses, error)
- func (dm *DealMap) SearchDeals(location string, query string, distanceMi int, startIndex int, pageSize int, ...) (*Deals, error)
- type Deals
Constants ¶
const ( Kids = 1 Group = 8 Romantic = 16 Casual = 64 Fun = 512 LateNight = 16384 Outdoor = 32768 )
Centered activity Values
const ( GiftCertificate = 1 BOGO = 2 PrintableCoupon = 4 GroupBuy = 8 DailyDeal = 16 FreeDeal = 32 )
Deal types
const ( Favorite = 1 // Favorited by The Dealmap Deal Editors HasTransaction = 2 // Involves some kind of purchase Featured = 4 // This deal is featured on The Dealmap Exclusive = 8 // This deal is exclusively available only at The Dealmap FiftyPercentOrMore = 16 // This deal has 50 or more % savings CanBePrinted = 32 // This is a printable coupon Affiliate = 64 // Affiliate )
Deal capability values
const ( Price = 1 Percentage = 2 )
Deal units
const ( USD = 1 GBP = 2 EUR = 3 )
Deal currency
const (
ApiUrl = "http://api.thedealmap.com"
)
Dealmap API information
const (
Unknown = 0
)
Unknown value
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Business ¶
type Business struct { Activity int AddressLine string Capability int Category string City string Country string Franchise string ID string Latitude float64 Longitude float64 MoreInfoLink string Phone string Ratings float64 Reviews int State string Title string }
Business contains the details of a business in TheDealMap. See the API documentation for details.
type Businesses ¶
type Businesses struct { Message string // Message from API, usually indicating a problem of some kind Results []Business `xml:"Results>Business"` // List of Business objects TotalResults int // Total number of results }
Businesses is an API response containing a list of Business objects and a response message
type Deal ¶
type Deal struct { Activity int AddedBy string AdditionalDiscountCouponCode string AdditionalDiscountCouponEffectiveTime string AdditionalDiscountCouponExpirationTime string AdditionalDiscountDealUnit int AdditionalDiscountedValue int AddressLine string Affiliation string BDescription string BusinessID string BusinessName string Capability int Category string City string Country string Currency int DealSource string DealType int DealUnit int Description string DiscountedValue float64 EffectiveTime string ExpirationTime string FaceValue float64 ID string IconUrl string ImageUrl string IsSoldOut bool Keywords string Latitude float64 Longitude float64 MoreInfoLink string Phone string Ratings float64 ReviewCount int SoldCount int State string Tags string Terms string Title string TrackingUrl string TransactionUrl string YouSave string ZipCode string }
A Deal contains all the details of a single deal. See TheDealMap API documentation for details.
func (*Deal) ParseAdditionalDiscountCouponEffectiveTime ¶
Attempts to parse the additional discount coupon's effective time
func (*Deal) ParseAdditionalDiscountCouponExpirationTime ¶
Attempts to parse the additional discount coupon's expiration time
func (*Deal) ParseEffectiveTime ¶
Attempts to parse the deal's effective time
type DealMap ¶
type DealMap struct {
// contains filtered or unexported fields
}
DealMap class to used to communicate with the API
func (*DealMap) DealDetails ¶
DealDetails invokes the "deal details" API from TheDeapMap and returns the response as a Deal object.
func (*DealMap) SearchBusinesses ¶
func (dm *DealMap) SearchBusinesses(location string, query string, distanceMi int, startIndex int, pageSize int, activity int) (*Businesses, error)
SearchBusinesses invokes the "search businesses" API from TheDealMap and returns the response as a Businesses object.
func (*DealMap) SearchDeals ¶
func (dm *DealMap) SearchDeals(location string, query string, distanceMi int, startIndex int, pageSize int, activity int, capability int, expirationDate time.Time) (*Deals, error)
SearchDeals invokes the "search deals" API from TheDealMap and returns the response as a Deals object.