dcas

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

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

func ValidateCID(id string) error

ValidateCID validates the given content ID

func ValidateDatastoreKey added in v0.1.5

func ValidateDatastoreKey(key string, value []byte) error

ValidateDatastoreKey validates the given data store key, ensuring that it conforms to the encoding used by the DCAS store store

func Validator

func Validator(_, _, _, key string, value []byte) error

Validator is an off-ledger validator that validates the CAS key against the value

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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL