30 lines
499 B
Go
30 lines
499 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, params params.Container) (any, error)
|
|
}
|
|
|
|
type Verb string
|
|
|
|
const (
|
|
VerbGet Verb = "get"
|
|
)
|