aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2023-03-04 10:56:43 +0100
committerRobin Jarry <robin@jarry.cc>2023-03-07 00:12:36 +0100
commit70dfd1bc40b633f83010ab1e5721a613f96efb87 (patch)
treee3d7a08e2eebfe1582fcc7b2325e9cdb8182d5fe
parent8b26dc1d62c8ec258707527953bd0d2195684adf (diff)
downloadaerc-70dfd1bc40b633f83010ab1e5721a613f96efb87.tar.gz
aerc-70dfd1bc40b633f83010ab1e5721a613f96efb87.zip
socket: extract functionality into ipc package
The current model of files dumped into lib does not follow the general advice not to have "util" classes. Naming the package "lib" does not change that it is a random assortments of functions that have some utility. Extracts socket functionality into it's own package. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--aerc.go8
-rw-r--r--lib/ipc/socket.go (renamed from lib/socket.go)2
2 files changed, 5 insertions, 5 deletions
diff --git a/aerc.go b/aerc.go
index b288084a..9ed4a2ca 100644
--- a/aerc.go
+++ b/aerc.go
@@ -22,8 +22,8 @@ import (
"git.sr.ht/~rjarry/aerc/commands/msgview"
"git.sr.ht/~rjarry/aerc/commands/terminal"
"git.sr.ht/~rjarry/aerc/config"
- "git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/crypto"
+ "git.sr.ht/~rjarry/aerc/lib/ipc"
"git.sr.ht/~rjarry/aerc/lib/templates"
libui "git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/log"
@@ -164,7 +164,7 @@ func main() {
return
} else if len(args) == 1 {
arg := args[0]
- err := lib.ConnectAndExec(arg)
+ err := ipc.ConnectAndExec(arg)
if err == nil {
return // other aerc instance takes over
}
@@ -218,7 +218,7 @@ func main() {
ui.EnableMouse()
}
- as, err := lib.StartServer()
+ as, err := ipc.StartServer()
if err != nil {
log.Warnf("Failed to start Unix server: %v", err)
} else {
@@ -233,7 +233,7 @@ func main() {
if retryExec {
// retry execution
arg := args[0]
- err := lib.ConnectAndExec(arg)
+ err := ipc.ConnectAndExec(arg)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to communicate to aerc: %v\n", err)
err = aerc.CloseBackends()
diff --git a/lib/socket.go b/lib/ipc/socket.go
index 5a41d910..27692a9b 100644
--- a/lib/socket.go
+++ b/lib/ipc/socket.go
@@ -1,4 +1,4 @@
-package lib
+package ipc
import (
"bufio"