code: func (h *apiExecutor) Unsubscribe(ctx context.Context, cmd *UnsubscribeRequest) *UnsubscribeResponse {
  	defer func(started time.Time) {
  		apiCommandDurationSummary.WithLabelValues(h.protocol, "unsubscribe").Observe(time.Since(started).Seconds())
  	}(time.Now())
  
  	resp := &UnsubscribeResponse{}
  
  	user := cmd.User
  	channel := cmd.Channel
  
  	if user == "" {
  		h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "user required for unsubscribe", map[string]interface{}{"channel": channel, "user": user}))
  		resp.Error = ErrorBadRequest
  		return resp
  	}
  
  	if channel != "" {
  		_, ok := h.node.ChannelOpts(channel)
  		if !ok {
  			resp.Error = ErrorNamespaceNotFound
  			return resp
  		}
  	}
  
  	err := h.node.Unsubscribe(user, channel)
  	if err != nil {
  		h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "error unsubscribing user from channel", map[string]interface{}{"channel": channel, "user": user, "error": err.Error()}))
  		resp.Error = ErrorInternal
  		return resp
  	}
  	return resp
  }
docs: // Unsubscribe unsubscribes user from channel and sends unsubscribe
  // control message to other nodes so they could also unsubscribe user.