(sh models.Shell, timeouts core.Timeouts)
| 37 | } |
| 38 | |
| 39 | func (p *Plugin) NewSession(sh models.Shell, timeouts core.Timeouts) (err error, clone *Plugin) { |
| 40 | p.Lock() |
| 41 | defer p.Unlock() |
| 42 | |
| 43 | if err, clone = LoadPlugin(p.Path); err != nil { |
| 44 | return |
| 45 | } |
| 46 | |
| 47 | clone.timeouts = timeouts |
| 48 | _, err = async.WithTimeout(timeouts.Connect, func() interface{} { |
| 49 | clone.ctx, err = clone.Call("Create", sh) |
| 50 | return err |
| 51 | }) |
| 52 | if err != nil { |
| 53 | return err, nil |
| 54 | } |
| 55 | return |
| 56 | } |
| 57 | |
| 58 | func (p *Plugin) Type() string { |
| 59 | return "plugin" |
no test coverage detected