Files
unifood/core/interfaces/handler.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

30 lines
522 B
Go

package interfaces
import (
"context"
"git.bissendorf.co/bissendorf/unifood/m/v2/core/interfaces/params"
)
type ResourceCommand[T any] struct {
Name string
Aliases []string
Description string
Verbs []Verb
Handler ResourceHandler
}
type ResourceHandler interface {
GetParametersForVerb(verb Verb) []params.Registration
}
type GetHandler interface {
Get(ctx context.Context, name string, params params.Container) (*ResourceList, error)
}
type Verb string
const (
VerbGet Verb = "get"
)