Documentation
¶
Index ¶
- Variables
- func GetCASKey(content []byte, version CIDVersion, codec, mhType uint64) (string, error)
- func GetCID(content []byte, version CIDVersion, codec, mhType uint64) (string, error)
- func ValidateCID(id string) error
- func ValidateDatastoreKey(key string, value []byte) error
- func Validator(_, _, _, key string, value []byte) error
- type CIDVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var Decorator = &decorator{}
Decorator is an off-ledger decorator that ensures the key is the hash of the value.
Functions ¶
func GetCASKey ¶ added in v0.1.5
func GetCASKey(content []byte, version CIDVersion, codec, mhType uint64) (string, error)
GetCASKey returns the key which will be used in the data store to store the value.
func GetCID ¶ added in v0.1.5
func GetCID(content []byte, version CIDVersion, codec, mhType uint64) (string, error)
GetCID returns the content ID (CID) of the value using the given CID version, codec, and multi-hash type.
func ValidateCID ¶ added in v0.1.5
ValidateCID validates the given content ID
func ValidateDatastoreKey ¶ added in v0.1.5
ValidateDatastoreKey validates the given data store key, ensuring that it conforms to the encoding used by the DCAS store store
Types ¶
type CIDVersion ¶ added in v0.1.5
type CIDVersion = uint64
CIDVersion specifies the version of the content ID (CID)
const ( // CIDV0 content ID (CID) version 0 CIDV0 CIDVersion = 0 // CIDV1 content ID (CID) version 1 CIDV1 CIDVersion = 1 )
Click to show internal directories.
Click to hide internal directories.