first commit

This commit is contained in:
andrzej 2024-11-05 22:25:51 +01:00
commit 8b5880c18d
3 changed files with 33 additions and 0 deletions

0
README.md Normal file
View File

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module gopaperctl
go 1.23.2

30
main.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"log"
"net"
"os"
)
func main() {
//TODO:more complex routing. It would be nice to be able to reload the config, for example
args := os.Args[1:]
var dir string
if len(args) > 0 {
dir = args[0]
} else {
log.Println("")
}
socket := "/tmp/gopaper.sock"
conn, err := net.Dial("unix", socket)
if err != nil {
log.Printf("Error dialing socket %v: %v\n", socket, err)
}
conn.Write([]byte(dir))
}