grappos

package module
v0.0.0-...-a35f776 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: MIT Imports: 6 Imported by: 0

README

Grappos

API client for the Grappos wine-searching API (https://www.grappos.com/api-setup/)

Build Status codecov GoDoc

Run Tests
▶ go test  -coverprofile=coverage.out
▶ go tool cover -html=coverage.out

Documentation

Overview

Package grappos an API wrapper for the Grappos API (https://www.grappos.com/api-setup/)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataRetriever

type DataRetriever struct {
	URL url.URL
}

DataRetriever holds the URL to fetch the data

func NewDataRetriever

func NewDataRetriever(m string) DataRetriever

NewDataRetriever creates a new DataRetriever to get all of the data

type LocationAPIResponse

type LocationAPIResponse struct {
	Locations []location `json:"locations"`
}

LocationAPIResponse Holds the API response.

func GetLocations

func GetLocations(n int) (LocationAPIResponse, error)

GetLocations Returns all locations.

func SearchForLocation

func SearchForLocation(l string) (LocationAPIResponse, error)

SearchForLocation Postal Code or City Name (ex: “13066”, “San Francisco”).

type ProductAPIResponse

type ProductAPIResponse struct {
	Products []product `json:"products"`
}

ProductAPIResponse Holds the API response.

func GetProducts

func GetProducts(u string) (ProductAPIResponse, error)

GetProducts Returns a list of Products.

type RetailerAPIResponse

type RetailerAPIResponse struct {
	Retailers []retailer `json:"retailers"`
}

RetailerAPIResponse Holds the API response.

func SearchBrandByID

func SearchBrandByID(id int, st string) (RetailerAPIResponse, error)

SearchBrandByID Searches for a retailer that has product(s) with a given BrandID.

func SearchCoordinates

func SearchCoordinates(lat string, lon string) (RetailerAPIResponse, error)

SearchCoordinates Searches a retailer based of their latitude and longitude.

func SearchProductByID

func SearchProductByID(id int, st string) (RetailerAPIResponse, error)

SearchProductByID Searches for a retailer that has a given ProductID.

Jump to

Keyboard shortcuts

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