22 lines
415 B
Go
22 lines
415 B
Go
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
|
|
}
|