first commit
This commit is contained in:
commit
8b5880c18d
|
@ -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))
|
||||||
|
}
|
Loading…
Reference in New Issue