Initial code commit (credentials daemon)

This commit is contained in:
2025-04-02 00:10:20 -04:00
parent 8465198e49
commit 1cd123ab31
6 changed files with 198 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"log"
"net"
"net/rpc"
)
func CallDaemon() string {
// connect to the UNIX domain socket
conn, err := net.Dial("unix", socketPath)
if err != nil {
log.Fatalf("Dial error: %v", err)
}
defer conn.Close()
// create an RPC client using the connection
client := rpc.NewClient(conn)
defer client.Close()
// request the passphrase from the RPC server
var reply string
err = client.Call("RCWService.GetPass", "hi", &reply)
if err != nil {
log.Fatalf("Error calling RCWService.GetPass: %v", err)
}
// return the passphrase
return reply
}