Documentation
¶
Overview ¶
Package svgastronomie provides functions to fetch the weekly menu of a SV restaurant from sv-gastronomie.de
Index ¶
Constants ¶
View Source
const ( BaseURL string = "https://sv-gastronomie.de" MenuURL string = BaseURL + "/menu" MenuTemplateURL string = BaseURL + "/menu/%s/%s" // %s is the restaurant URL )
Below are constants used in the svgastronomie package.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Day ¶
type Day struct {
Time time.Time `json:"time"` // Time is the current date in the format YYYY-MM-DD 00:00:00 UTC.
Dishes []Dish `json:"dishes"`
}
Day represents the menu for a specific day.
type Dish ¶
type Dish struct {
Name string `json:"name"`
Description string `json:"description"`
Price float64 `json:"price"`
Tags []string `json:"tags"`
}
Dish represents a single dish available on a specific day.
type Restaurant ¶
type Restaurant struct {
URL string `json:"url"`
Location string `json:"location"`
MenuCard string `json:"menu_card"`
Week Week `json:"week"`
}
Restaurant represents a restaurant available on sv-gastronomie.de.
func ScrapeRestaurant ¶
func ScrapeRestaurant( url string, handleNewDay func(day Day), ) (*Restaurant, error)
ScrapeRestaurant scrapes the restaurant's page and returns a Restaurant object.
The handleNewDay is an optional callback function that can be used to handle new days as they are scraped.
Click to show internal directories.
Click to hide internal directories.