Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beer ¶
type Beer struct { ID int `json:"bid"` Name string `json:"beer_name"` Label string `json:"beer_label"` Ibu int `json:"beer_ibu"` Abv float64 `json:"beer_abv"` Style string `json:"beer_style"` Description string `json:"beer_description"` // only available from the BeerInfo API Slug string `json:"beer_slug,omitempty"` RatingCount int `json:"rating_count,omitempty"` RatingScore float64 `json:"rating_score,omitempty"` Brewery *Brewery `json:"brewery,omitempty"` }
Beer defines the shape of a Beer from the Untappd API Note: only fields used by slappd are included here
type Brewery ¶
type Brewery struct {
Name string `json:"brewery_name"`
}
Brewery defines the shape of a Brewery from the Untappd API Note: only fields used by slappd are included here
type InfoResponse ¶
type InfoResponse struct { Response struct { Beer *Beer `json:"beer"` } `json:"response"` }
InfoResponse defines the shape of the response from the UntappdAPI /v4/beer/info/:beerID endpoint
func Info ¶
func Info(id string) (*InfoResponse, error)
Info calls the UntappdAPI /v4/beer/info/:beerID endpoint
func (*InfoResponse) Text ¶
func (i *InfoResponse) Text() string
Text produces slack formatted text for the InfoResponse
func (*InfoResponse) Title ¶
func (i *InfoResponse) Title() string
Title produces a slack formatted title for the InfoResponse
type SearchItem ¶
SearchItem defines the shape if the nested Items in SearchResponse
func (*SearchItem) Text ¶
func (i *SearchItem) Text() string
Text produces slack formatted text for the SearchItem
func (*SearchItem) Title ¶
func (i *SearchItem) Title() string
Title produces a slack formatted title for the SearchItem
type SearchResponse ¶
type SearchResponse struct { Response struct { Beers struct { Items []*SearchItem } } }
SearchResponse defines the shape of the response from the UntappdAPI /v4/search/beer endpoint
func Search ¶
func Search(searchStr string) (*SearchResponse, error)
Search calls the UntappdAPI /v4/search/beer endpoint