sdk

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 5 Imported by: 0

README

Build Status

bolaget.io-sdk-go

Versions

This SDK adheres to Semantic Versioning. And it will follow bolaget.io versions.

Version Linked to
^1.0.0 https://bolaget.io/v1

Import

import (
  b "github.com/larsha/bolaget.io-sdk-go"
)

Get products

Query params available here bolaget.io

products, err := b.GetProducts(b.ProductQueryParams{Limit: 1})

Get stores

Query params available here bolaget.io

stores, err := b.GetStores(b.StoreQueryParams{Limit: 1})

Get product

product, err := b.GetProduct("123")

Get store

store, err := b.GetStore("123")

Documentation

Index

Constants

View Source
const URL = "https://bolaget.io/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Price

type Price struct {
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type Product

type Product struct {
	Nr                 string  `json:"nr"`
	ArticleId          int     `json:"article_id"`
	ArticleNr          int     `json:"article_nr"`
	Name               string  `json:"name"`
	AdditionalName     string  `json:"additional_name"`
	Price              Price   `json:"price"`
	VolumeInMilliliter float64 `json:"volume_in_milliliter"`
	PricePerLiter      float64 `json:"price_per_liter"`
	SalesStart         string  `json:"sales_start"`
	Expired            bool    `json:"expired"`
	ProductGroup       string  `json:"product_group"`
	Type               string  `json:"type"`
	Style              string  `json:"style"`
	Packaging          string  `json:"packaging"`
	Sealing            string  `json:"sealing"`
	Origin             string  `json:"origin"`
	OriginCountry      string  `json:"origin_country"`
	Producer           string  `json:"producer"`
	Provider           string  `json:"provider"`
	Year               int     `json:"year"`
	YearTested         string  `json:"year_tested"`
	Alcohol            string  `json:"alcohol"`
	Assortment         string  `json:"assortment"`
	AssortmentText     string  `json:"assortment_text"`
	Ecological         bool    `json:"ecological"`
	Ethical            bool    `json:"ethical"`
	Koscher            bool    `json:"koscher"`
	Commodities        string  `json:"commodities"`
}

func GetProduct

func GetProduct(nr string) (Product, error)

func GetProducts

func GetProducts(p ProductQueryParams) ([]Product, error)

type ProductQueryParams

type ProductQueryParams struct {
	Limit          int     `url:"limit"`
	Offset         int     `url:"offset"`
	Ecological     bool    `url:"ecological"`
	Koscher        bool    `url:"koscher"`
	Ethical        bool    `url:"ethical"`
	YearFrom       int     `url:"year_from"`
	YearTo         int     `url:"year_to"`
	PriceFrom      float64 `url:"price_from"`
	PriceTo        float64 `url:"price_to"`
	VolumeFrom     float64 `url:"volume_from"`
	VolumeTo       float64 `url:"volume_to"`
	Assortment     string  `url:"assortment"`
	AssortmentText string  `url:"assortment_text"`
	Sort           string  `url:"sort"`
	Name           string  `url:"name"`
	Type           string  `url:"type"`
	Style          string  `url:"style"`
	Provider       string  `url:"provider"`
	Producer       string  `url:"producer"`
	Origin         string  `url:"origin"`
	OriginCountry  string  `url:"origin_country"`
	Packaging      string  `url:"packaging"`
	ProductGroup   string  `url:"product_group"`
	Sealing        string  `url:"sealing"`
	Search         string  `url:"search"`
	SalesStartFrom string  `url:"sales_start_from"`
	SalesStartTo   string  `url:"sales_start_to"`
	Commodities    string  `url:"commodities"`
}

type Store

type Store struct {
	Nr                string   `json:"nr"`
	City              string   `json:"city"`
	Name              string   `json:"name"`
	Address           string   `json:"address"`
	AdditionalAddress string   `json:"additional_address"`
	ZipCode           string   `json:"zip_code"`
	County            string   `json:"county"`
	Phone             string   `json:"phone"`
	ShopType          string   `json:"shop_type"`
	Services          string   `json:"services"`
	Labels            []string `json:"labels"`
	OpeningHours      []string `json:"opening_hours"`
	RT90X             int      `json:"RT90x"`
	RT90Y             int      `json:"RT90y"`
}

func GetStore

func GetStore(nr string) (Store, error)

func GetStores

func GetStores(params StoreQueryParams) ([]Store, error)

type StoreQueryParams

type StoreQueryParams struct {
	Limit   int    `url:"limit"`
	Offset  int    `url:"offset"`
	Labels  string `url:"labels"`
	Search  string `url:"search"`
	Type    string `url:"type"`
	Name    string `url:"name"`
	City    string `url:"city"`
	Country string `url:"country"`
	Address string `url:"address"`
	Sort    string `url:"sort"`
}

Jump to

Keyboard shortcuts

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