func main() { rpcAddr := flag.String("RPCAddr", "", "Address for RPC communication with host application") flag.Parse() if err := rpc.Register(&Calculator{}); err == nil { if p, err := plugins.NewPlugin("calculator (increments by two)", "calcService", &plugins.Options{Address: *rpcAddr}); err == nil { p.Serve() } } }
func ExampleNewPlugin() { if p, err := plugins.NewPlugin("calculator", "calcService", &plugins.Options{tcpPort: 5000}); err == nil { p.Serve() } }