feat: resource list and table output formatter
This commit is contained in:
@ -4,13 +4,14 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"git.bissendorf.co/bissendorf/unifood/m/v2/core/interfaces"
|
||||
"github.com/goccy/go-yaml"
|
||||
)
|
||||
|
||||
type YamlFormatter struct{}
|
||||
|
||||
func (f *YamlFormatter) Format(objects []any) (io.Reader, error) {
|
||||
buffer, err := yaml.Marshal(objects)
|
||||
func (f *YamlFormatter) Format(list *interfaces.ResourceList) (io.Reader, error) {
|
||||
buffer, err := yaml.Marshal(list)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user