summaryrefslogtreecommitdiff
path: root/internal/types/protocol.go
diff options
context:
space:
mode:
authortjp <tjp@ctrl-c.club>2023-11-13 07:25:39 -0700
committertjp <tjp@ctrl-c.club>2023-11-13 07:27:16 -0700
commit1e0f8e0aaeaf1bd2ee39c02e922238b641bcf88b (patch)
tree020e5de91f2343119fed10dede9d2c8262a3cd83 /internal/types/protocol.go
parenta808b4692656c10bb43e2d54a2f5ef2746d231d5 (diff)
refactor contribs to work with a Protocol interface
Diffstat (limited to 'internal/types/protocol.go')
-rw-r--r--internal/types/protocol.go19
1 files changed, 19 insertions, 0 deletions
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)
+}