Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusActive = "active" StatusCanceled = "cancelled" StatusPendingTrans = "pending_transaction" StatusPurchased = "purchased" )
View Source
const ( CoordinateKey = "results.0.location.coordinates" PriceRangesKey = "results.0.delivery_specs.delivery_pricing" )
View Source
const DeliveryCoordinatesPath = "details.delivery_info.location.coordinates.coordinates"
Variables ¶
This section is empty.
Functions ¶
func Distance ¶
func Distance(first, second Coordinate) float64
Distance function returns the distance (in meters) between two points of
a given longitude and latitude relatively accurately (using a spherical approximation of the Earth) through the Haversin Distance Formula for great arc distance on a sphere with accuracy for small distances
point coordinates are supplied in degrees and converted into rad. in the func
distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula
Types ¶
type Coordinate ¶
func CoordinateFromArray ¶
func CoordinateFromArray(arrayContainer *gabs.Container) (Coordinate, error)
type DistanceRange ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func NewGroupWithExistingID ¶
func NewGroupWithExistingID(woltAddrs WoltAddr, retryConfig RetryConfig, id string) (*Group, error)
func (*Group) Details ¶
func (g *Group) Details() (*OrderDetails, error)
func (*Group) MarkAsReady ¶
func (*Group) VenueDetails ¶
func (g *Group) VenueDetails() (*VenueDetails, error)
type OrderDetails ¶
type OrderDetails struct {
ParsedOutput *gabs.Container
}
func (*OrderDetails) DeliveryCoordinate ¶
func (o *OrderDetails) DeliveryCoordinate() (Coordinate, error)
func (*OrderDetails) Host ¶
func (o *OrderDetails) Host() (string, error)
func (*OrderDetails) RateByPerson ¶
func (o *OrderDetails) RateByPerson() (map[string]float64, error)
func (*OrderDetails) Status ¶
func (o *OrderDetails) Status() (string, error)
func (*OrderDetails) VenueID ¶
func (o *OrderDetails) VenueID() (string, error)
type OrderHistory ¶
type OrderHistory struct {
// contains filtered or unexported fields
}
func (*OrderHistory) DeliveryRateForOrder ¶
func (o *OrderHistory) DeliveryRateForOrder(orderPrettyID string) (int, error)
func (*OrderHistory) GetOrderJsonByID ¶
func (o *OrderHistory) GetOrderJsonByID(orderPrettyID string) (*gabs.Container, bool)
type PriceRanges ¶
type PriceRanges struct { BasePrice int `json:"base_price"` DistanceRanges []DistanceRange `json:"distance_ranges"` }
type RetryConfig ¶ added in v1.0.1
type VenueDetails ¶
type VenueDetails struct {
ParsedOutput *gabs.Container
}
func (*VenueDetails) CalculateDeliveryRate ¶
func (v *VenueDetails) CalculateDeliveryRate(source Coordinate) (int, error)
func (*VenueDetails) Location ¶
func (v *VenueDetails) Location() (Coordinate, error)
func (*VenueDetails) PriceRanges ¶
func (v *VenueDetails) PriceRanges() (PriceRanges, error)
Click to show internal directories.
Click to hide internal directories.