aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ipc/handler.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2023-03-04 10:56:46 +0100
committerRobin Jarry <robin@jarry.cc>2023-03-07 00:12:55 +0100
commitc6a08b1003a2cb02d86002541ead0f9b38db1beb (patch)
tree80dead95349d263b8bad20c17b6005b523367485 /lib/ipc/handler.go
parent4838efdb1d5a746432a30ef0b86b090aab52fa7a (diff)
downloadaerc-c6a08b1003a2cb02d86002541ead0f9b38db1beb.tar.gz
ipc: use an interface instead of a function list
Currently, every function has to be mapped to the according handler with our god-object. To make adding new handlers require less changes, change this mapping into an interface that is satisfied by *widgets.Aerc Signed-off-by: Moritz Poldrack <git@moritz.sh> Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ipc/handler.go')
-rw-r--r--lib/ipc/handler.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ipc/handler.go b/lib/ipc/handler.go
new file mode 100644
index 00000000..fb8f0e06
--- /dev/null
+++ b/lib/ipc/handler.go
@@ -0,0 +1,8 @@
+package ipc
+
+import "net/url"
+
+type Handler interface {
+ Mailto(addr *url.URL) error
+ Mbox(source string) error
+}