code: func (c *Controller) OnShutdown(fn func() error) {
  	c.instance.onShutdown = append(c.instance.onShutdown, fn)
  }
docs: // OnShutdown adds fn to the list of callback functions to execute
  // when the server is about to be shut down (including restarts).