Files
unifood/model/resources/resources.go
bdoerfchen 4b7866da03 feat: add universities and restaurants (#4)
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>
2025-07-20 22:13:03 +00:00

21 lines
497 B
Go

package resources
import "strings"
const ResourceResource = "resource"
type Resource struct {
ResourceName string
Aliases []string
Description string
}
func (r *Resource) Kind() string { return ResourceResource }
func (r *Resource) ItemName() string { return r.ResourceName }
// Table output
func (r *Resource) ColumnNames() []string { return []string{"Aliases", "Description"} }
func (r *Resource) Columns() []any {
return []any{strings.Join(r.Aliases, ", "), r.Description}
}