From 1e0f8e0aaeaf1bd2ee39c02e922238b641bcf88b Mon Sep 17 00:00:00 2001 From: tjp Date: Mon, 13 Nov 2023 07:25:39 -0700 Subject: refactor contribs to work with a Protocol interface --- internal/types/protocol.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/types/protocol.go (limited to 'internal/types/protocol.go') diff --git a/internal/types/protocol.go b/internal/types/protocol.go new file mode 100644 index 0000000..7166d8f --- /dev/null +++ b/internal/types/protocol.go @@ -0,0 +1,19 @@ +package types + +import ( + "io" + "net/url" +) + +type ServerProtocol interface { + TemporaryRedirect(*url.URL) *Response + PermanentRedirect(*url.URL) *Response + + TemporaryServerError(error) *Response + PermanentServerError(error) *Response + CGIFailure(error) *Response + + Success(filename string, body io.Reader) *Response + + ParseResponse(io.Reader) (*Response, error) +} -- cgit v1.2.3