feat: resource list and table output formatter

This commit is contained in:
2025-07-20 19:22:36 +02:00
parent 45712dacf6
commit 4a15a4db66
16 changed files with 209 additions and 40 deletions

View File

@ -19,7 +19,7 @@ type ResourceHandler interface {
}
type GetHandler interface {
Get(ctx context.Context, params params.Container) ([]any, error)
Get(ctx context.Context, params params.Container) (*ResourceList, error)
}
type Verb string

View File

@ -1,7 +1,14 @@
package interfaces
import "io"
import (
"io"
)
type Formatter interface {
Format(object []any) (io.Reader, error)
Format(object *ResourceList) (io.Reader, error)
}
type TableOutput interface {
ColumnNames() []string
Columns() []any
}

View File

@ -0,0 +1,12 @@
package interfaces
type Resource interface {
Kind() string
Name() string
}
type ResourceList struct {
ItemKind string
Items []Resource
}