summaryrefslogtreecommitdiff
path: root/nex/response.go
diff options
context:
space:
mode:
authortjp <tjp@ctrl-c.club>2023-11-13 07:27:36 -0700
committertjp <tjp@ctrl-c.club>2023-11-13 07:27:36 -0700
commit629e6a0e0c3a24f35888036f957ee3a631e62816 (patch)
tree76001a2311d3566bf0050b3ef2aa3119fe0823bf /nex/response.go
parent1e0f8e0aaeaf1bd2ee39c02e922238b641bcf88b (diff)
add nex protocol support
Diffstat (limited to 'nex/response.go')
-rw-r--r--nex/response.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/nex/response.go b/nex/response.go
new file mode 100644
index 0000000..165f161
--- /dev/null
+++ b/nex/response.go
@@ -0,0 +1,18 @@
+package nex
+
+import (
+ "bytes"
+ "io"
+
+ "tildegit.org/tjp/sliderule/internal/types"
+)
+
+// Response builds a nex Response from an io.Reader.
+func Response(body io.Reader) *types.Response {
+ return &types.Response{Body: body}
+}
+
+// StringResponse builds a nex Response from a string.
+func StringResponse(body string) *types.Response {
+ return Response(bytes.NewBufferString(body))
+}