wolt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

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

type Coordinate struct {
	Lat float64
	Lon float64
}

func CoordinateFromArray

func CoordinateFromArray(arrayContainer *gabs.Container) (Coordinate, error)

type DistanceRange

type DistanceRange struct {
	AddedPrice  int `json:"a"`
	MinDistance int `json:"min"`
	MaxDistance int `json:"max"`
}

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) Join

func (g *Group) Join() error

func (*Group) MarkAsReady

func (g *Group) MarkAsReady() error

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 RetryConfig struct {
	HTTPMaxRetries       int
	HTTPMinRetryDuration time.Duration
	HTTPMaxRetryDuration time.Duration
}

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)

type WoltAddr

type WoltAddr struct {
	BaseAddr    string
	APIBaseAddr string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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