code: func (c *Controller) OnRestart(fn func() error) {
  	c.instance.onRestart = append(c.instance.onRestart, fn)
  }
docs: // OnRestart adds fn to the list of callback functions to execute
  // when the server is about to be restarted.