systembolaget

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

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

Go to latest
Published: Dec 21, 2014 License: MIT Imports: 5 Imported by: 0

README

systembolaget

systembolaget is a Go client library for accessing the Systembolaget API

GoDoc

License

MIT

Documentation

Overview

Package systembolaget provides a client library for accessing the Systembolaget API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Number            string `xml:"nr,omitempty"`
	ArticleId         string `xml:"Artikelid,omitempty"` // Unique number.
	ProductNumber     string `xml:"Varnummer,omitempty"` // One or more articles can share the same ProductNumber.
	Name              string `xml:"Namn,omitempty"`
	SubName           string `xml:"Namn2,omitempty"`
	Price             string `xml:"Prisinklmoms,omitempty"` // Price, VAT included.
	VolumeMl          string `xml:"Volymiml,omitempty"`     // Volume in millilitre.
	PricePerLitre     string `xml:"PrisPerLiter,omitempty"`
	SoldSince         string `xml:"Saljstart,omitempty"`
	DiscontinuedSince string `xml:"Slutlev,omitempty"`
	ProductGroup      string `xml:"Varugrupp,omitempty"`
	ContainerType     string `xml:"Forpackning,omitempty"`
	SealingType       string `xml:"Forslutning,omitempty"`
	Origin            string `xml:"Ursprung,omitempty"`
	OriginCountry     string `xml:"Ursprunglandnamn,omitempty"`
	Producer          string `xml:"Producent,omitempty"`
	Distributer       string `xml:"Leverantor,omitempty"`
	AnnualVolume      string `xml:"Argang,omitempty"`
	TestAnnualValume  string `xml:"Provadargang,omitempty"`
	AlcoholPrecentage string `xml:"Alkoholhalt,omitempty"`
	Assortment        string `xml:"Sortiment,omitempty"`
	Organic           string `xml:"Ekologisk,omitempty"`
	Kosher            string `xml:"Koscher,omitempty"`
	PrimaryProducts   string `xml:"RavarorBeskrivning,omitempty"`
}

type Articles

type Articles struct {
	CreatedAt   string    `xml:"skapad-tid,omitempty"`
	InfoMessage string    `xml:"info>meddelande,omitempty"`
	Articles    []Article `xml:"artikel"`
}

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

Returns a new Systembolaget API client. If a nil httpClient is provided, http.DefaultClient will be used.

func (*Client) Articles

func (c *Client) Articles() (*Articles, error)

Returns all articles. Note: downloads large XML file.

func (*Client) Stores

func (c *Client) Stores() (*Stores, error)

Returns all stores. Note: downloads large XML file.

type Store

type Store struct {
	Number       string `xml:"Nr,omitempty"`
	Type         string `xml:"Typ,omitempty"`
	Adress1      string `xml:"Address1,omitempty"`
	Adress2      string `xml:"Address2,omitempty"`
	Adress3      string `xml:"Address3,omitempty"`
	Adress4      string `xml:"Address4,omitempty"`
	Adress5      string `xml:"Address5,omitempty"`
	PhoneNumber  string `xml:"Telefon,omitempty"`
	StoreType    string `xml:"ButiksTyp,omitempty"`
	Services     string `xml:"Tjanster,omitempty"`
	SearchWords  string `xml:"SokOrd,omitempty"`
	OpeningHours string `xml:"Oppettider,omitempty"`
	RT90x        string `xml:"RT90x,omitempty"`
	RT90y        string `xml:"RT90y,omitempty"`
}

type Stores

type Stores struct {
	InfoMessage string  `xml:"Info>Meddelande"`
	Stores      []Store `xml:"ButikOmbud"`
}

Jump to

Keyboard shortcuts

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