Documentation ¶
Index ¶
Constants ¶
View Source
const ( //Today for today Today = "today" //Tomorrow for tomorrow Tomorrow = "tomorrow" //EventsResourcePath represents path to retrieve a collection of event resources EventsResourcePath = "events" //LocationResourcePath represents path to retrieve a location resource LocationResourcePath = "locations/%s" //TruckResourcePath represents path to retrieve truck TruckResourcePath = "trucks/%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` EventID int `json:"event_id"` Bookings []struct { ID int `json:"id"` Status string `json:"status"` Paid bool `json:"paid"` Truck struct { Name string `json:"name"` Trailer bool `json:"trailer"` FoodCategories []string `json:"food_categories"` ID string `json:"id"` UID int `json:"uid"` FeaturedPhoto string `json:"featured_photo"` } `json:"truck"` } `json:"bookings"` WaitlistEntries []struct { ID int `json:"id"` Expiration interface{} `json:"expiration"` Position int `json:"position"` Truck struct { Slug string `json:"slug"` } `json:"truck"` } `json:"waitlist_entries"` }
Event represent an event
type EventsResponse ¶
type EventsResponse struct { Pagination struct { Page int `json:"page"` TotalPages int `json:"total_pages"` TotalCount int `json:"total_count"` } `json:"pagination"` Events []Event `json:"events"` }
EventsResponse is response from events api
type FoodTruckClient ¶
type FoodTruckClient interface { GetEvents(id string, onDay string) ([]Event, error) GetLocation(id string) (Location, error) GetTruck(id string) (Truck, error) }
FoodTruckClient represents generic interface for Seattle FoodTruck API client
func NewFoodTruckClient ¶
func NewFoodTruckClient(ctx context.Context, host, scheme, basePath string) FoodTruckClient
NewFoodTruckClient returns a new instance of Food Truck Client
type Location ¶
type Location struct { Name string `json:"name"` Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` Address string `json:"address"` Photo string `json:"photo"` GooglePlaceID string `json:"google_place_id"` CreatedAt string `json:"created_at"` NeighborhoodID int `json:"neighborhood_id"` Slug string `json:"slug"` FilteredAddress string `json:"filtered_address"` ID string `json:"id"` UID int `json:"uid"` Neighborhood struct { Name string `json:"name"` ID int `json:"id"` } `json:"neighborhood"` Pod struct { Name string `json:"name"` Slug string `json:"slug"` Description string `json:"description"` LoadInSheet string `json:"load_in_sheet"` W9Required bool `json:"w9_required"` CoiRequired bool `json:"coi_required"` HealthRequired bool `json:"health_required"` HealthSnohomishRequired interface{} `json:"health_snohomish_required"` } `json:"pod"` }
Location represents a location where you can find truck
type Truck ¶
type Truck struct { Name string `json:"name"` Rating float64 `json:"rating"` UserID int `json:"user_id"` Featured bool `json:"featured"` RatingCount int `json:"rating_count"` ID string `json:"id"` UID int `json:"uid"` FeaturedPhoto string `json:"featured_photo"` Facebook string `json:"facebook"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Twitter string `json:"twitter"` Instagram string `json:"instagram"` Yelp string `json:"yelp"` Description string `json:"description"` Phone string `json:"phone"` Email string `json:"email"` Website string `json:"website"` Active bool `json:"active"` ContactName string `json:"contact_name"` TruckLength int `json:"truck_length"` TruckWidth int `json:"truck_width"` Trailer bool `json:"trailer"` AcceptsCreditCards bool `json:"accepts_credit_cards"` GlutenFree bool `json:"gluten_free"` Vegetarian bool `json:"vegetarian"` Vegan bool `json:"vegan"` Paleo bool `json:"paleo"` FutureBookings int `json:"future_bookings"` FuturePodEvents int `json:"future_pod_events"` Coi string `json:"coi"` CoiExpiration string `json:"coi_expiration"` CoiStatus string `json:"coi_status"` CoiApproved bool `json:"coi_approved"` Health string `json:"health"` HealthExpiration string `json:"health_expiration"` HealthStatus string `json:"health_status"` HealthApproved bool `json:"health_approved"` W9 string `json:"w9"` W9Expiration interface{} `json:"w9_expiration"` W9Status string `json:"w9_status"` W9Approved bool `json:"w9_approved"` HealthSnohomish string `json:"health_snohomish"` HealthSnohomishExpiration string `json:"health_snohomish_expiration"` HealthSnohomishStatus string `json:"health_snohomish_status"` HealthSnohomishApproved bool `json:"health_snohomish_approved"` MenuItems []struct { Name string `json:"name"` Description string `json:"description"` Price float64 `json:"price"` ID int `json:"id"` } `json:"menu_items"` Photos []struct { ID int `json:"id"` File string `json:"file"` Position int `json:"position"` } `json:"photos"` RelatedTrucks []struct { Name string `json:"name"` Rating float64 `json:"rating"` RatingCount int `json:"rating_count"` ID string `json:"id"` FeaturedPhoto string `json:"featured_photo"` FoodCategories []struct { Name string `json:"name"` ID string `json:"id"` UID int `json:"uid"` } `json:"food_categories"` } `json:"related_trucks"` FoodCategories []struct { Name string `json:"name"` ID string `json:"id"` UID int `json:"uid"` } `json:"food_categories"` }
Truck represents a food truck
Click to show internal directories.
Click to hide internal directories.