Features: - Allow to search for individual resources by their name - Add new resources and their handler: Universities, Restaurants - Added new parameter to reverse output order Reviewed-on: #4 Co-authored-by: bdoerfchen <git@bissendorf.co> Co-committed-by: bdoerfchen <git@bissendorf.co>
22 lines
503 B
Go
22 lines
503 B
Go
package resources
|
|
|
|
const ResourceRestaurant = "restaurant"
|
|
|
|
type Restaurant struct {
|
|
Name string
|
|
Title string
|
|
ID string
|
|
Address string
|
|
Image string
|
|
OpeningHours any
|
|
}
|
|
|
|
func (r *Restaurant) Kind() string { return ResourceRestaurant }
|
|
func (r *Restaurant) ItemName() string { return r.Name }
|
|
|
|
// Table output
|
|
func (r *Restaurant) ColumnNames() []string { return []string{"ID", "Title"} }
|
|
func (r *Restaurant) Columns() []any {
|
|
return []any{r.ID, r.Title}
|
|
}
|