exporter

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByDate

type ByDate []*Order

ByDate implements sort.Interface for []Order based on the CreatedAt field.

func (ByDate) Len

func (o ByDate) Len() int

func (ByDate) Less

func (o ByDate) Less(i, j int) bool

func (ByDate) Swap

func (o ByDate) Swap(i, j int)

type Delivery

type Delivery struct {
	Retailer    string
	DeliveredAt time.Time
	Items       []Item
}

Delivery is a purchase at a particular retailer.

type Item

type Item struct {
	ID        string
	ProductID string
	Quantity  int
	Name      string
}

Item represents a purchased item in the delivery.

type Order

type Order struct {
	ID         string
	Status     string
	Total      string
	CreatedAt  time.Time
	Deliveries []Delivery
}

Order is the complete transaction.

type OrderService

type OrderService struct {
	// contains filtered or unexported fields
}

OrderService implements business logic for exporting orders from Instacart.

func NewOrderService

func NewOrderService(client *instacart.Client) *OrderService

NewOrderService creates a new OrderService.

func (*OrderService) GetOrderPages

func (o *OrderService) GetOrderPages(start, end int) ([]*Order, error)

GetOrderPages retrieves pages of orders starting with start and ending with end, inclusive. Results are returned in reverse chronological order.

Jump to

Keyboard shortcuts

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