feat: add resource handler (#2)
Features: - Adds the new meta-resource "Resource" with its resource handler Reviewed-on: #2 Co-authored-by: bdoerfchen <git@bissendorf.co> Co-committed-by: bdoerfchen <git@bissendorf.co>
This commit is contained in:
17
model/resources/resources.go
Normal file
17
model/resources/resources.go
Normal file
@ -0,0 +1,17 @@
|
||||
package resources
|
||||
|
||||
import "strings"
|
||||
|
||||
type Resource struct {
|
||||
ResourceName string
|
||||
Aliases []string
|
||||
Description string
|
||||
}
|
||||
|
||||
func (r *Resource) Kind() string { return "Resource" }
|
||||
func (r *Resource) Name() string { return r.ResourceName }
|
||||
|
||||
func (r *Resource) ColumnNames() []string { return []string{"Aliases", "Description"} }
|
||||
func (r *Resource) Columns() []any {
|
||||
return []any{strings.Join(r.Aliases, ", "), r.Description}
|
||||
}
|
||||
Reference in New Issue
Block a user