Documentation ¶
Overview ¶
Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func SafeURLSegmentNZ(s string) error
- func URLDataProof(blockNum uint64, dbname, key string, deleted bool) string
- func URLForGetConfig() string
- func URLForGetDBIndex(dbName string) string
- func URLForGetDBStatus(dbName string) string
- func URLForGetData(dbName, key string) string
- func URLForGetDataDeletedBy(userID string) string
- func URLForGetDataRange(dbName, startKey, endKey string, limit uint64) string
- func URLForGetDataReadBy(userID string) string
- func URLForGetDataReaders(dbName, key string) string
- func URLForGetDataWriters(dbName, key string) string
- func URLForGetDataWrittenBy(userID string) string
- func URLForGetHistoricalData(dbName, key string) string
- func URLForGetHistoricalDataAt(dbName, key string, version *types.Version) string
- func URLForGetHistoricalDataAtOrBelow(dbName, key string, version *types.Version) string
- func URLForGetHistoricalDeletedData(dbName, key string) string
- func URLForGetMostRecentNodeConfig(nodeID string, version *types.Version) string
- func URLForGetMostRecentUserInfo(userID string, version *types.Version) string
- func URLForGetNextHistoricalData(dbName, key string, version *types.Version) string
- func URLForGetPreviousHistoricalData(dbName, key string, version *types.Version) string
- func URLForGetTransactionReceipt(txId string) string
- func URLForGetTxIDsSubmittedBy(userID string) string
- func URLForGetUser(userID string) string
- func URLForJSONQuery(dbName string) string
- func URLForLastLedgerBlock() string
- func URLForLedgerBlock(blockNum uint64, augmented bool) string
- func URLForLedgerPath(start, end uint64) string
- func URLForNodeConfigPath(nodeID string) string
- func URLTxContent(blockNum uint64, txIdx uint64) string
- func URLTxProof(blockNum uint64, txIdx uint64) string
Constants ¶
const ( UserHeader = "UserID" SignatureHeader = "Signature" TimeoutHeader = "TxTimeout" UserEndpoint = "/user/" GetUser = "/user/{userid}" PostUserTx = "/user/tx" DataEndpoint = "/data/" // GetData Keys in URLs are expected to be encoded in base64 URL encoding without padding. GetData = "/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/{key}" GetDataRange = "/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}" PostDataTx = "/data/tx" PostDataQuery = "/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/jsonquery" DBEndpoint = "/db/" GetDBStatus = "/db/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}" GetDBIndex = "/db/index/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}" PostDBTx = "/db/tx" ConfigEndpoint = "/config/" PostConfigTx = "/config/tx" GetConfig = "/config/tx" GetNodeConfigPath = "/config/node" GetNodeConfig = "/config/node/{nodeId}" GetLastConfigBlock = "/config/block/last" GetClusterStatus = "/config/cluster" 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 Keys in URLs are expected to be encoded in base64 URL encoding without padding. GetDataProof = "/ledger/proof/data/{dbname:" + `[0-9a-zA-Z_\-\.]+` + "}/{key}" GetTxReceipt = "/ledger/tx/receipt/{txId}" GetTxContentPrefix = "/ledger/tx/content" GetTxContent = "/ledger/tx/content/{blockId:[0-9]+}" ProvenanceEndpoint = "/provenance/" // GetHistoricalData Keys in URLs are expected to be encoded in base64 URL encoding without padding. GetHistoricalData = "/provenance/data/history/{dbname}/{key}" // GetDataReaders Keys in URLs are expected to be encoded in base64 URL encoding without padding. GetDataReaders = "/provenance/data/readers/{dbname}/{key}" // GetDataWriters Keys in URLs are expected to be encoded in base64 URL encoding without padding. 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}" )
const ( // Combination operators QueryOpAnd = "$and" QueryOpOr = "$or" // Logical operators QueryOpEqual = "$eq" QueryOpNotEqual = "$neq" QueryOpGreaterThan = "$gt" QueryOpLesserThan = "$lt" QueryOpGreaterThanOrEqual = "$gte" QueryOpLesserThanOrEqual = "$lte" // Top-level fields allowed in the query QueryFieldSelector = "selector" )
Variables ¶
This section is empty.
Functions ¶
func SafeURLSegmentNZ ¶
SafeURLSegmentNZ checks that the string `s` is safe to use as a URL segment-nz. For example: `http://example.com:8080/tx/my-id`, for s="my-id". See: `https://www.ietf.org/rfc/rfc3986.txt`.
func URLDataProof ¶
URLDataProof returns URL for GET request to retrieve a data existence proof. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetConfig ¶
func URLForGetConfig() string
URLForGetConfig returns url for GET request to retrieve the cluster configuration
func URLForGetDBIndex ¶ added in v0.2.2
URLForGetDBIndex returns url for GET request to retrieve the index definition of a given database
func URLForGetDBStatus ¶
URLForGetDBStatus returns url for GET request to find status of a given database
func URLForGetData ¶
URLForGetData returns url for GET request to retrieve value of the key present in the dbName. Keys in URLs are expected to be encoded in base64 URL encoding without padding.
func URLForGetDataDeletedBy ¶
URLForGetDataDeletedBy returns url for GET request to retrieve all data written by a given user
func URLForGetDataRange ¶ added in v0.2.4
URLForGetDataRange returns url for GET request to retrieve a range of values. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetDataReadBy ¶
URLForGetDataReadBy returns url for GET request to retrieve all data read by a given user
func URLForGetDataReaders ¶
URLForGetDataReaders returns url for GET request to retrieve all users who have read a given key from a database. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetDataWriters ¶
URLForGetDataWriters returns url for GET request to retrieve all users who have written a given key from a database. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetDataWrittenBy ¶
URLForGetDataWrittenBy returns url for GET request to retrieve all data written by a given user
func URLForGetHistoricalData ¶
URLForGetHistoricalData returns url for GET request to retrieve all values associated with a given key on a database. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetHistoricalDataAt ¶
URLForGetHistoricalDataAt returns url for GET request to retrieve a value at a particular version for a given key on a database. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetHistoricalDataAtOrBelow ¶
URLForGetHistoricalDataAtOrBelow returns url for GET request to retrieve a most recent value at a particular version for a given key on a database Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetHistoricalDeletedData ¶
URLForGetHistoricalDeletedData returns url for GET request to retrieve all deleted values associated with a given key on a database. Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetNextHistoricalData ¶
URLForGetNextHistoricalData returns url for GET request to retrieve next values for a given key on a database from a particular version Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetPreviousHistoricalData ¶
URLForGetPreviousHistoricalData returns url for GET request to retrieve previous values for a given key on a database from a particular version Keys in URLs are encoded in base64 URL encoding without padding.
func URLForGetTxIDsSubmittedBy ¶
URLForGetTxIDsSubmittedBy returns url for GET request to retrieve all txIDs submitted by a given user
func URLForGetUser ¶
URLForGetUser returns url for GET request to retrieve a user information
func URLForJSONQuery ¶
URLForJSONQuery returns url for GET request to retrieve key-value pairs present in the dbName which are matching the given JSON query criteria
func URLForLastLedgerBlock ¶
func URLForLastLedgerBlock() string
func URLForLedgerBlock ¶
func URLForLedgerPath ¶
func URLForNodeConfigPath ¶
func URLTxContent ¶ added in v0.2.8
func URLTxProof ¶
Types ¶
This section is empty.