func NewStorageHandler(service *sdk.DeviceService, logger logger.LoggingClient, asyncValues chan<- *models.AsyncValues) *StorageHandler {
	handler := StorageHandler{
		service:     service,
		logger:      logger,
		asyncValues: asyncValues,
		helper:      resthelper.GetHelper(),
	}
	return &handler
}
NewStorageHandler creates and returns a handler for DataStorage.
package storagedriver
import (
	"context"
	b64 "encoding/base64"
	"fmt"
	"github.com/lf-edge/edge-home-orchestration-go/internal/controller/storagemgr/config"
	dbhelper "github.com/lf-edge/edge-home-orchestration-go/internal/db/helper"
	"github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/resthelper"
	"io/ioutil"
	"math"
	"net/http"
	"time"
	"github.com/gorilla/mux"
	"github.com/spf13/cast"
	"github.com/edgexfoundry/device-sdk-go/pkg/models"
	sdk "github.com/edgexfoundry/device-sdk-go/pkg/service"
	"github.com/edgexfoundry/go-mod-core-contracts/clients"
	"github.com/edgexfoundry/go-mod-core-contracts/clients/logger"
)
type ctxKey string
const (
	deviceNameKey            = "deviceName"
	resourceNameKey          = "resourceName"
	startKey                 = "start"
	endKey                   = "end"
	handlerContextKey ctxKey = "StorageHandler"
	configPath               = "res/configuration.toml"
	numberOfReadings         = "readingCount"
	apiResourceRoute               = clients.ApiBase + "/device/{" + deviceNameKey + "}/resource/{" + resourceNameKey + "}"
	apiResourceRouteMultiple       = clients.ApiBase + "/device/{" + deviceNameKey + "}/resource/{" + resourceNameKey + "}/{" + numberOfReadings + "}"
	apiWithoutResRoute             = clients.ApiBase + "/resource/{" + resourceNameKey + "}"
	apiWithoutResRouteMultiple     = clients.ApiBase + "/resource/{" + resourceNameKey + "}/{" + numberOfReadings + "}"
	apiWithoutResRouteTimeMultiple = clients.ApiBase + "/start/{" + startKey + "}/end/{" + endKey + "}/{" + numberOfReadings + "}"
)
var (
	dbIns = dbhelper.GetInstance()
)
type StorageHandler struct {
	service     *sdk.DeviceService
	logger      logger.LoggingClient
	asyncValues chan<- *models.AsyncValues
	helper      resthelper.RestHelper
}