func (s *Server) getAllOrders() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		span, ctx := ot.StartSpanFromContext(r.Context(), "getAllOrders")
		defer span.Finish()
		log := util.RequestIDLogger(s.logger, r)
		defaultErrMsg := "unable to retrieve orders"
		keys, err := s.RedisScanOrders(ctx)
		if err != nil {
			log.Errorw("unable to SCAN redis for keys",
				"error", err,
			)
			s.Respond(ctx, http.StatusInternalServerError, defaultErrMsg, 0, nil, w)
			return
		}
		var orders = []*Order{}
		for _, k := range keys {
			o, err := s.RedisGetOrder(ctx, k)
			if err != nil {
				log.Errorw("unable to get get order",
					"key", k,
					"error", err,
				)
				s.Respond(ctx, http.StatusInternalServerError, defaultErrMsg, 0, nil, w)
				return
			}
			orders = append(orders, o)
		}
		l := len(orders)
		if l == 0 {
			s.Respond(ctx, http.StatusNotFound, "no orders present", 0, nil, w)
			return
		}
		s.Respond(ctx, http.StatusOK, "orders retrieved", l, orders, w)
	}
}
getAllOrders retrieves all orders from Redis
package order
import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"math/rand"
	"net/http"
	"strconv"
	"time"
	"github.com/gorilla/mux"
	"github.com/obitech/micro-obs/util"
	ot "github.com/opentracing/opentracing-go"
	"github.com/pkg/errors"
)
func (s *Server) notFound() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		span, ctx := ot.StartSpanFromContext(r.Context(), "notFound")
		defer span.Finish()
		s.Respond(ctx, http.StatusNotFound, "resource not found", 0, nil, w)
	}
}
func (s *Server) pong() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		span, ctx := ot.StartSpanFromContext(r.Context(), "pong")
		defer span.Finish()
		log := util.RequestIDLogger(s.logger, r)
		log.Info("pong")
		s.Respond(ctx, http.StatusOK, "pong", 0, nil, w)
	}
}