pas/helper/response.go

18 lines
423 B
Go
Raw Normal View History

2024-07-14 04:49:21 +02:00
package helper
import (
"fmt"
"strings"
"git.gay/exhq/pas/Constants"
2024-07-14 04:49:21 +02:00
)
2024-07-15 20:24:27 +02:00
func IntentGenerator(res Constants.Response) string {
2024-07-14 04:49:21 +02:00
headersString := ""
2024-07-15 20:24:27 +02:00
for key, value := range res.ResponseHeader {
2024-07-14 04:49:21 +02:00
headersString += fmt.Sprintf("%s:%s\n", key, value)
}
headersString = strings.TrimSuffix(headersString, "\n")
2024-07-15 20:24:27 +02:00
return fmt.Sprintf("PAS %s\n%s\n\n%s", string(res.OperationSuccessClassification), headersString, res.Body)
2024-07-14 04:49:21 +02:00
}