| // invoker is the object that implements the Root interface |
| // NewInvoker is the invoker factory. |
| func NewInvoker() *invoker { |
| // ROOT INTERFACE IMPLEMENTATION |
| // resetLinux implements the Reset method for Linux. |
| func (i *invoker) resetLinux(deadline uint64) { |
| time.Sleep(time.Duration(deadline) * time.Millisecond) |
| cmd := exec.Command("shutdown", "-r", "now") |
| vlog.VI(0).Infof("Shutting down.") |
| func (i *invoker) Reset(call ipc.ServerContext, deadline uint64) error { |
| vlog.VI(0).Infof("Reset(%v).", deadline) |
| go i.resetLinux(deadline) |
| // TODO(jsimsa): Implement Reset method for additional operating |
| return errors.New("Unsupported operating system: " + runtime.GOOS) |