Skip to content

Instantly share code, notes, and snippets.

@ctdk ctdk/velikij.go
Last active Aug 29, 2015

Embed
What would you like to do?
A sample plugin for gosudar.
package main
// A demonstration of a gosudar plugin. For now, place the compiled binary in /tmp/plugins.
import (
"net"
"net/rpc/jsonrpc"
"os"
)
func main() {
conn, err := net.Dial("unix", "/tmp/gosudar.sock")
if err != nil {
panic(err)
}
defer conn.Close()
values := make(map[string]interface{})
values["zzz"] = "zuz"
var reply string
c := jsonrpc.NewClient(conn)
err = c.Call("Info.SendInfo", values, &reply)
if err != nil {
panic(err)
}
os.Exit(0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.