feat: add name formatter

This commit is contained in:
2025-07-24 21:19:40 +02:00
parent 723aae48ce
commit 79c6a1ea8a
2 changed files with 22 additions and 0 deletions

21
core/output/name.go Normal file
View File

@ -0,0 +1,21 @@
package output
import (
"bytes"
"io"
"git.bissendorf.co/bissendorf/unifood/m/v2/core/interfaces"
)
type NameFormatter struct{}
func (f *NameFormatter) Format(list *interfaces.ResourceList) (io.Reader, error) {
var buffer = make([]byte, 0, 1024)
outputBuffer := bytes.NewBuffer(buffer)
for _, item := range list.Items {
outputBuffer.WriteString(item.ItemName() + "\r\n")
}
return outputBuffer, nil
}