code: func (h *apiExecutor) History(ctx context.Context, cmd *HistoryRequest) *HistoryResponse {
  	defer func(started time.Time) {
  		apiCommandDurationSummary.WithLabelValues(h.protocol, "history").Observe(time.Since(started).Seconds())
  	}(time.Now())
  
  	resp := &HistoryResponse{}
  
  	ch := cmd.Channel
  
  	if ch == "" {
  		resp.Error = ErrorBadRequest
  		return resp
  	}
  
  	chOpts, ok := h.node.ChannelOpts(ch)
  	if !ok {
  		resp.Error = ErrorNamespaceNotFound
  		return resp
  	}
  
  	if chOpts.HistorySize <= 0 || chOpts.HistoryLifetime <= 0 {
  		resp.Error = ErrorNotAvailable
  		return resp
  	}
  
  	history, err := h.node.History(ch)
  	if err != nil {
  		h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "error calling history", map[string]interface{}{"error": err.Error()}))
  		resp.Error = ErrorInternal
  		return resp
  	}
  
  	apiPubs := make([]*Publication, len(history))
  
  	for i, pub := range history {
  		apiPub := &Publication{
  			UID:  pub.UID,
  			Data: Raw(pub.Data),
  		}
  		if pub.Info != nil {
  			apiPub.Info = &ClientInfo{
  				User:     pub.Info.User,
  				Client:   pub.Info.Client,
  				ConnInfo: Raw(pub.Info.ConnInfo),
  				ChanInfo: Raw(pub.Info.ChanInfo),
  			}
  		}
  		apiPubs[i] = apiPub
  	}
  
  	resp.Result = &HistoryResult{
  		Publications: apiPubs,
  	}
  	return resp
  }
docs: // History returns response with history information for channel.