// Start starts Task func (p *PluginManager) Start() { if runtime.GOOS == "windows" { p.plugin = pingo.NewPlugin("tcp", p.path) } else { p.plugin = pingo.NewPlugin("unix", p.path) } p.plugin.Start() }
func (h *Hand) MakeFinger(name string, flags map[string]bool, args []string) (*FingerClient, error) { f := new(FingerClient) f.Path = path.Join(h.Home, name, name) f.finger = pingo.NewPlugin("tcp", f.Path) f.args = makeArgs(flags, args) return f, nil }
func runPlugin(proto, path string) { p := pingo.NewPlugin(proto, path) p.Start() defer p.Stop() objs, err := p.Objects() if err != nil { fmt.Println(err) return } fmt.Printf("Objects: %s\n", objs) var resp string if err := p.Call("Plugin.SayHello", "from your plugin", &resp); err != nil { fmt.Println(err) } else { fmt.Printf("%s\n", resp) } if err := p.Call("Plugin.SayHello", "from your plugin, second call", &resp); err != nil { fmt.Println(err) } else { fmt.Printf("%s\n", resp) } }
func testHighlight() { p := pingo.NewPlugin("tcp", "E:\\gopath\\src\\github.com\\get3w\\get3w\\packages\\highlight\\highlight.exe") p.Start() defer p.Stop() options := map[string]string{ "xx": "yy", } var resp packages.Plugin if err := p.Call("Highlight.Load", options, &resp); err != nil { log.Print(err) } else { log.Print(resp) } }
func testHelloWorld() { // Make a new plugin from the executable we created. Connect to it via TCP p := pingo.NewPlugin("tcp", "E:\\gopath\\src\\github.com\\get3w\\get3w\\packages\\hello-world\\hello-world.exe") // Actually start the plugin p.Start() // Remember to stop the plugin when done using it defer p.Stop() var resp string // Call a function from the object we created previously if err := p.Call("MyPlugin.SayHello", "Go developer", &resp); err != nil { log.Print(err) } else { log.Print(resp) } }
func (self *SassContext) AddPlugin(path string) { plugin := pingo.NewPlugin("tcp", path) self.plugins = append(self.plugins, plugin) }