func URLForGetDataWrittenBy(userID string) string {
	return ProvenanceEndpoint + path.Join("data", "written", userID)
}
URLForGetDataWrittenBy returns url for GET request to
retrieve all data written by a given user
package constants
import (
	"fmt"
	"path"
	"strconv"
	"github.com/hyperledger-labs/orion-server/pkg/types"
)
const (
	UserHeader      = "UserID"
	SignatureHeader = "Signature"
	TimeoutHeader   = "TxTimeout"
	UserEndpoint = "/user/"
	GetUser      = "/user/{userid}"
	PostUserTx   = "/user/tx"
	DataEndpoint  = "/data/"
	GetData       = "/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/{key}"
	PostDataTx    = "/data/tx"
	PostDataQuery = "/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/jsonquery"
	DBEndpoint  = "/db/"
	GetDBStatus = "/db/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}"
	PostDBTx    = "/db/tx"
	ConfigEndpoint = "/config/"
	PostConfigTx   = "/config/tx"
	GetConfig      = "/config/tx"
	GetNodesConfig = "/config/node"
	GetNodeConfig  = "/config/node/{nodeId}"
	LedgerEndpoint     = "/ledger/"
	GetBlockHeader     = "/ledger/block/{blockId:[0-9]+}"
	GetLastBlockHeader = "/ledger/block/last"
	GetPath            = "/ledger/path"
	GetTxProofPrefix   = "/ledger/proof/tx"
	GetTxProof         = "/ledger/proof/tx/{blockId:[0-9]+}"
	GetDataProofPrefix = "/ledger/proof/data"
	GetDataProof       = "/ledger/proof/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/{key}"
	GetTxReceipt       = "/ledger/tx/receipt/{txId}"
	ProvenanceEndpoint      = "/provenance/"
	GetHistoricalData       = "/provenance/data/history/{dbname}/{key}"
	GetDataReaders          = "/provenance/data/readers/{dbname}/{key}"
	GetDataWriters          = "/provenance/data/writers/{dbname}/{key}"
	GetDataReadBy           = "/provenance/data/read/{userId}"
	GetDataWrittenBy        = "/provenance/data/written/{userId}"
	GetDataDeletedBy        = "/provenance/data/deleted/{userId}"
	GetTxIDsSubmittedBy     = "/provenance/data/tx/{userId}"
	GetMostRecentUserOrNode = "/provenance/{type:user|node}/{id}"
)
func URLForGetData(dbName, key string) string {
	return DataEndpoint + path.Join(dbName, key)
}
func URLForJSONQuery(dbName string) string {
	return DataEndpoint + path.Join(dbName, "jsonquery")
}
func URLForGetUser(userID string) string {
	return UserEndpoint + userID
}
func URLForGetDBStatus(dbName string) string {
	return DBEndpoint + dbName
}
func URLForGetConfig() string {
	return GetConfig
}
func URLForLedgerBlock(blockNum uint64) string {
	return LedgerEndpoint + path.Join("block", strconv.FormatUint(blockNum, 10))
}
func URLForLastLedgerBlock() string {
	return GetLastBlockHeader
}
func URLForLedgerPath(start, end uint64) string {
	return LedgerEndpoint + fmt.Sprintf("path?start=%d&end=%d", start, end)
}
func URLTxProof(blockNum uint64, txIdx int) string {
	return LedgerEndpoint + fmt.Sprintf("proof/tx/%d?idx=%d", blockNum, txIdx)
}
func URLDataProof(blockNum uint64, dbname, key string, deleted bool) string {
	if deleted {
		return LedgerEndpoint + fmt.Sprintf("proof/data/%s/%s?block=%d&deleted=%t", dbname, key, blockNum, deleted)
	}
	return LedgerEndpoint + fmt.Sprintf("proof/data/%s/%s?block=%d", dbname, key, blockNum)
}
func URLForNodeConfigPath(nodeID string) string {
	return path.Join(GetNodesConfig, nodeID)
}
func URLForGetHistoricalData(dbName, key string) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key)
}
func URLForGetHistoricalDeletedData(dbName, key string) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key) + "?onlydeletes=true"
}
func URLForGetHistoricalDataAt(dbName, key string, version *types.Version) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key) +
		fmt.Sprintf("?blocknumber=%d&transactionnumber=%d", version.BlockNum, version.TxNum)
}
func URLForGetHistoricalDataAtOrBelow(dbName, key string, version *types.Version) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key) +
		fmt.Sprintf("?blocknumber=%d&transactionnumber=%d", version.BlockNum, version.TxNum) +
		fmt.Sprintf("&mostrecent=true")
}
func URLForGetPreviousHistoricalData(dbName, key string, version *types.Version) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key) +
		fmt.Sprintf("?blocknumber=%d&transactionnumber=%d", version.BlockNum, version.TxNum) +
		"&direction=previous"
}
func URLForGetNextHistoricalData(dbName, key string, version *types.Version) string {
	return ProvenanceEndpoint + path.Join("data", "history", dbName, key) +
		fmt.Sprintf("?blocknumber=%d&transactionnumber=%d", version.BlockNum, version.TxNum) +
		"&direction=next"
}
func URLForGetDataReaders(dbName, key string) string {
	return ProvenanceEndpoint + path.Join("data", "readers", dbName, key)
}
func URLForGetDataWriters(dbName, key string) string {
	return ProvenanceEndpoint + path.Join("data", "writers", dbName, key)
}
func URLForGetDataReadBy(userID string) string {
	return ProvenanceEndpoint + path.Join("data", "read", userID)
}