code: func (a *Agent) registerEndpoint(name string, handler interface{}) error {
  	srv, ok := a.delegate.(*consul.Server)
  	if !ok {
  		panic("agent must be a server")
  	}
  	realname := fmt.Sprintf("%s-%d", name, time.Now().UnixNano())
  	a.endpointsLock.Lock()
  	a.endpoints[name] = realname
  	a.endpointsLock.Unlock()
  	return srv.RegisterEndpoint(realname, handler)
  }
docs: // registerEndpoint registers a handler for the consul RPC server
  // under a unique name while making it accessible under the provided
  // name. This allows overwriting handlers for the golang net/rpc
  // service which does not allow this.