From 629e6a0e0c3a24f35888036f957ee3a631e62816 Mon Sep 17 00:00:00 2001 From: tjp Date: Mon, 13 Nov 2023 07:27:36 -0700 Subject: add nex protocol support --- nex/response.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 nex/response.go (limited to 'nex/response.go') 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)) +} -- cgit v1.2.3